Re: how to print without blank?

2006-04-09 Thread Steven D'Aprano
On Sat, 08 Apr 2006 22:54:17 -0700, Ju Hui wrote: > I want to print 3 numbers without blank. [snip] > how to print > 012 > ? Method one: accumulate your numbers into a single string, then print it in one go. >>> L = [] >>> for x in range(3): ... L.append(str(x)) ... >>> print ''.join(L) 012

Decorators, Identity functions and execution...

2006-04-09 Thread Chance Ginger
If I define a decorator like: def t(x) : def I(x) : return x return I and use it like: @t(X) def foo(a) : # definition of foo... pass or maybe this: @t(X) @(Y) def bar(a) : # The definition of bar... Will in encounter much of a penalty in executing 'f

Re: Confused by "format requires a mapping"

2006-04-09 Thread Fredrik Lundh
[EMAIL PROTECTED] wrote: > I'm very new to Python, and unsure how to handle this runtime error > below. Pointers in the right direction (RTFM here ... etc) most > appreciated. > > I have an object, called article, that when printed has the following > structure: > > {'title': 'wbk', 'entries': [('

Re: Mysterious EOFError

2006-04-09 Thread Steven D'Aprano
On Sat, 08 Apr 2006 23:07:54 -0700, Rex Eastbourne wrote: > Hi, > > I'm executing a python script as a cron job. When I run it myself from > the command line it works, but when cron executes it I get an EOFError: > > File "/home/rex/cronscript.py", line 6, in ? > level = int(raw_input("hello

Re: Automated Graph Plotting in Python

2006-04-09 Thread Paddy
Hi, I saw you mentioned gnuplot and did a search on Google of 'gnuplot python-wrapper' which lead me eventually to: http://gnuplot-py.sourceforge.net/ I have not tried it, but if you would try it and report back if it works that might help someone else too. - Cheerio, Paddy. -- http://mail.py

Re: how relevant is C today?

2006-04-09 Thread Carl Friedrich Bolz
Grant Edwards wrote: > On 2006-04-08, Martin v. Löwis <[EMAIL PROTECTED]> wrote: > >>As for *learning* the languages: never learn a language >>without a specific inducement. > > That's silly. Learning (weather a computer language, a natural > language, or anything else) is never a bad thing. Th

Re: Pickle or Mysql

2006-04-09 Thread amaltasb
Can i install berkeley db on BSD, I am having a virtual private server, so I have privilates to install on it and do we have management tools like phpmyadmin from berkely db as well, as I am not so good at database management. Thanks Amaltas -- http://mail.python.org/mailman/listinfo/python-list

Writing files on server through CGI

2006-04-09 Thread amaltasb
I have a CGI script on server which process a form and writes its content on a file like fp = open(fname, 'w') fp.write('Cool list%s%s Its working fine, but will it work if the script recieves thousands of request simultaneously. Can this script writes files simultaneusly or will all the request q

Re: Curses and Character Handling

2006-04-09 Thread Fulvio
Alle 10:46, domenica 09 aprile 2006, [EMAIL PROTECTED] ha scritto: > Does anyone know of a solution to this I still learning python, but probably some documentation is the basis of learning, rather than ask at the list. I suggest to see at http://docs.python.org/ for actual and growing python f

Re: programming puzzles?

2006-04-09 Thread Fredrik Lundh
[EMAIL PROTECTED] wrote: > The trouble with word lists is when you run across something > you don't recognize, like "ixodid", you can't tell if it's a word or > an acronym or an abbreviation. Being in the environmental > remediation business, I thought "dioxid" (which I assume is > related to "dio

Re: how relevant is C today?

2006-04-09 Thread Martin v. Löwis
John Zenger wrote: > Your message makes me sad, as if I heard someone say "never read a book > without a specific inducement; if you know someone is going to ask you > about the book, start reading it today, but if you don't know what you > are going to use the book for, reading it will be a waste

StringIO.readline() returns ''

2006-04-09 Thread Max
I'm using StringIO for the first time (to buffer messages recieved from a socket). I thought it would be a simple matter of writing the stuff to the buffer and then calling readline, but that doesn't seem to work: >>> buf = StringIO.StringIO() >>> buf.write("Foo\n") >>> buf.write("Bar\n") >>>

Re: how relevant is C today?

2006-04-09 Thread Martin v. Löwis
Grant Edwards wrote: >> As for *learning* the languages: never learn a language >> without a specific inducement. > > That's silly. Learning (weather a computer language, a natural > language, or anything else) is never a bad thing. The more > languages you know, the more you understand about la

Re: how relevant is C today?

2006-04-09 Thread Martin v. Löwis
Carl Friedrich Bolz wrote: > I don't exactly see why this is a contradiction. "Specific inducement" > does not necessarily mean that you have to have an external cause to > learn a language -- be it your job or whatever. Nobody hinders you from > creating that inducement yourself. It's just very ha

Re: StringIO.readline() returns ''

2006-04-09 Thread Fredrik Lundh
"Unknown" wrote: > I'm using StringIO for the first time (to buffer messages recieved from > a socket). I thought it would be a simple matter of writing the stuff to > the buffer and then calling readline, but that doesn't seem to work: > > >>> buf = StringIO.StringIO() > >>> buf.write("Foo\n")

Re: Decorators, Identity functions and execution...

2006-04-09 Thread Fredrik Lundh
Chance Ginger" wrote: > If I define a decorator like: > > def t(x) : > def I(x) : return x > return I ... you get a syntax error. > and use it like: > > @t(X) > def foo(a) : > # definition of foo... > pass that's also a syntax error. > or maybe this: > > @t(X) > @(Y) > def bar(a) : > # The def

Re: Programming Tutorial for absolute beginners

2006-04-09 Thread Frank Millman
Clodoaldo Pinto wrote: > James wrote: > > On the calculator page you describe the difference between 3.0 / 2 and > > 3 / 2, but an absolute beginner probably wouldn't know about the > > difference between integers and floats, or even what the two terms > > meant. If you don't know much about compu

Re: programming puzzles?

2006-04-09 Thread [EMAIL PROTECTED]
Fredrik Lundh wrote: > [EMAIL PROTECTED] wrote: > > > The trouble with word lists is when you run across something > > you don't recognize, like "ixodid", you can't tell if it's a word or > > an acronym or an abbreviation. Being in the environmental > > remediation business, I thought "dioxid" (wh

Re: How to determine if a line of python code is a continuation of the line above it

2006-04-09 Thread Hans Georg Krauthaeuser
Sandra-24 wrote: > I'm not sure how complex this is, I've been brainstorming a little, and > I've come up with: > > If the previous line ended with a comma or a \ (before an optional > comment) > > That's easy to cover with a regex > > But that doesn't cover everything, because this is legal: >

[Newbie] Referring to a global variable inside a function

2006-04-09 Thread Ernesto García García
Hi experts, I've built a class for parsing a user-defined list of files and matching lines with a user-defined list of regular expressions. It looks like this: import re import glob class LineMatcher: """ Parses a list of text files, matching their lines with the given regular expression

Re: [Newbie] Referring to a global variable inside a function

2006-04-09 Thread Fredrik Lundh
Ernesto García García wrote: > But then, when I try to use my class using actions with "memory" it will > fail: > > > import LineMatcher > > global count > count = 0 > > def line_action(line, match_dictionary): >count = count + 1 > > line_matcher = LineMatcher.LineMatcher() > line_matcher.add

Re: StringIO.readline() returns ''

2006-04-09 Thread Max
Fredrik Lundh wrote: > you forgot to rewind the file: > Thank you. > > > --Max -- http://mail.python.org/mailman/listinfo/python-list

Re: Decorators, Identity functions and execution...

2006-04-09 Thread Chance Ginger
On Sun, 09 Apr 2006 09:51:18 +0200, Fredrik Lundh wrote: > Chance Ginger" wrote: > >> If I define a decorator like: >> >> def t(x) : >> def I(x) : return x >> return I > > ... you get a syntax error. > It isn't a syntax error...I tried it before I posted. In fact def t(x) : def I(x) :

wxStyledTextCtrl - Dead?

2006-04-09 Thread David Rasmussen
I have several questions about wxStyledTextCtrl: 1) Is it still being maintained? 2) Where are the docs and tutorials? 3) Is it wxStyledTextCtrl, wx.StyledTextCtrl, StyledTextCtrl, or... ? 4) Is there an alternative? /David -- http://mail.python.org/mailman/listinfo/python-list

Re: fnmatch on filename (without specific extension)

2006-04-09 Thread Peter Hansen
kepioo wrote: > I have some files in a directory : > Results Log, 11;21AM, Apr 09 2006.txt > Results Log, 11;21AM, Apr 08 2006.txt > Results Log, 03;59AM, Apr 07 2006.txt > otherfile1.txt > otherfile2.txt > > I'd like to copy all the Results Log file, whatever the hour but with a > specific day. F

Round

2006-04-09 Thread HeidiWeber
Hello i´m a beginner in python. With version 14 in SPSS (statistic software) there are the posibility to use python. i want do the following: double NCases NCases=10/6 is this correct in python? Because in SPSS there are an error message. Thank you very much cu Heidi -- http://mail.python.or

Re: mod_python + apache + winxp => nogo

2006-04-09 Thread cyberco
Thanks Jim, I indeed did not look in the mailinglist archive (you have to subscribe for that and Google didn't cache it yet). The problem was indeed the missing .DLL's. After adding them to my 'PATH' variable apache was at least able to start. Unfortunately things still don't work. When I try to l

Re: Round

2006-04-09 Thread Diez B. Roggisch
HeidiWeber wrote: > Hello > > i´m a beginner in python. With version 14 in SPSS (statistic software) > there are the posibility to use python. > > i want do the following: > > double NCases > NCases=10/6 > > is this correct in python? Because in SPSS there are an error message. No, its not co

Re: Programming Tutorial for absolute beginners

2006-04-09 Thread Clodoaldo Pinto
Duncan Smith wrote: > > But as you use conversions to float in order to avoid integer division > in your code examples, it might be best to explain what's going on, even > if you do have to explain the relevant types. > I changed the comments in the first program that uses float() to: # The raw_i

Re: Programming Tutorial for absolute beginners

2006-04-09 Thread Clodoaldo Pinto
Frank Millman wrote: > > We know that Python is in the process of changing the division > operator. The main reason for the change is that the current approach > is not intuitive to a newcomer (whether experienced or not). > > Why not think to the future, and do it like this. Instruct the reader >

Re: Round

2006-04-09 Thread Ravi Teja
No! That is NOT correct Python. For one thing, you do not declare the types in dynamically typed languages. Secondly, if you want floating point division, you need to enter atleast one of the numbers as float. For example 10.0/6 or 10./6 or float(10)/6 You will find the following helpful. http://

Re: Tkinter

2006-04-09 Thread Jay
Now I just get this error message. AttributeError: 'int' object has no attribute 'image' But the picture appears so I am almost their. ---START--- from Tkinter import * class App: def __init__(self, root): self.MainFrame = Canvas(root) self.MainFrame.pack(fill=BOTH, expand=

Re: Automated Graph Plotting in Python

2006-04-09 Thread Kent Johnson
[EMAIL PROTECTED] wrote: > My python program spits lot of data. I take that data and plot graphs > using OfficeOrg spredsheet. I want to automate this task as this takes > so much of time. I have some questions. > > 1. Which is the best graph plotting utility in python or linux. Can I > write a co

Re: fnmatch on filename (without specific extension)

2006-04-09 Thread kepioo
i agree with you, it is better to find by ourself. i managed to do it, but i left the code at work. i used the re module , using a re.match("Results Log") and a re.search(date) with a function to find the date og the day with the appropriate format. Is it ok to use re for file names? or fnmatch i

Re: Round

2006-04-09 Thread HeidiWeber
thank you very much to you i wish you a nice sunday... cu Heidi -- http://mail.python.org/mailman/listinfo/python-list

Re: how to print without blank?

2006-04-09 Thread Rick Zantow
Steven D'Aprano <[EMAIL PROTECTED]> wrote in news:[EMAIL PROTECTED]: > On Sat, 08 Apr 2006 22:54:17 -0700, Ju Hui wrote: > >> I want to print 3 numbers without blank. > [snip] >> how to print >> 012 >> ? > > Method one: accumulate your numbers into a single string, then print > it in one go. >

Re: how to print without blank?

2006-04-09 Thread Ju Hui
thank you all. IT's very helpful to me. >>> import sys >>> def no_space_before(x): ... sys.stdout.softspace = 0 ... return x ... >>> for x in range(3): ... print no_space_before(x), ... 012 -- http://mail.python.org/mailman/listinfo/python-list

I wanna use urllib2 to get a page with a socks 5 proxy, who can give me a sample code ?

2006-04-09 Thread Ju Hui
I wanna use urllib2 to get a page with a socks 5 proxy,who can give me a sample code ? example, the proxy server is :123.123.123.123 and the port is :1080 and the username/password is : user/pass I want to open http://www.google.com how to write this kind of script? thanks. -- http://mail.pyt

Re: Decorators, Identity functions and execution...

2006-04-09 Thread Jorge Godoy
Chance Ginger <[EMAIL PROTECTED]> writes: > On Sun, 09 Apr 2006 09:51:18 +0200, Fredrik Lundh wrote: > >> Chance Ginger" wrote: >> >>> If I define a decorator like: >>> >>> def t(x) : >>> def I(x) : return x >>> return I >> >> ... you get a syntax error. >> > > It isn't a syntax error...I tried

Re: Decorators, Identity functions and execution...

2006-04-09 Thread Fredrik Lundh
Chance Ginger wrote: > It isn't a syntax error...I tried it before I posted. In fact > def t(x) : > def I(x) : return x > return I > > is correct. tabs don't make it through all channels. don't use tabs for indentation when you post to newsgroups or mailing lists. and @(Y) is not valid Python s

Re: mod_python + apache + winxp => nogo

2006-04-09 Thread Jim Gallacher
cyberco wrote: > Thanks Jim, I indeed did not look in the mailinglist archive (you have > to subscribe for that and Google didn't cache it yet). > > The problem was indeed the missing .DLL's. After adding them to my > 'PATH' variable apache was at least able to start. Unfortunately things > still

Re: Decorators, Identity functions and execution...

2006-04-09 Thread Carl Banks
Chance Ginger wrote: > On Sun, 09 Apr 2006 09:51:18 +0200, Fredrik Lundh wrote: > > > Chance Ginger" wrote: > > > >> If I define a decorator like: > >> > >> def t(x) : > >> def I(x) : return x > >> return I > > > > ... you get a syntax error. > > > > It isn't a syntax error...I tried it before I p

Re: More pythonic circle?

2006-04-09 Thread Pythor
Michael Tobis wrote: > Proving yet again that it's possible to write Fortran in any language. > Ouch... > You aren't getting any benefit from numpy or python here. Are you > aiming for speed or legibility? > Speed will be a necessity, eventually. I was just really aiming for something that work

Re: More pythonic circle?

2006-04-09 Thread Pythor
Steven D'Aprano wrote: > No, "minimum number of space characters" means "you don't use enough > spaces", not "your variable names are too short" *wink* > Hmm. Guess I can't read too well. > Within a single line, a good guideline is to leave a single space on > either side of pluses and minuses (

Re: More pythonic circle?

2006-04-09 Thread Fredrik Lundh
"Pythor" wrote: > > You aren't getting any benefit from numpy or python here. Are you > > aiming for speed or legibility? > > > Speed will be a necessity, eventually. I was just really aiming for > something that works, and that I am capable of writing. any special reason you cannot use an exis

Re: how relevant is C today?

2006-04-09 Thread Scott David Daniels
Sandra-24 wrote: > C/C++ is used for a lot of things and not going anywhere. > > I recommend you learn it not because you should create applications in > C or C++, but because it will increase your skills and value as a > programmer. I recommend you even spend a few weeks with an assembly > langua

Re: Decorators, Identity functions and execution...

2006-04-09 Thread Chance Ginger
First, thanks for the tip of 'tabs'. I keep forgetting Outlook has some interesting rules about displaying text. Thanks for the comment about happening at load time. That resolved the problem (in my thinking)! I don't believe I have an issue at all... Peace, CG. On Sun, 09 Apr 2006 08:52:18 -070

Re: Tkinter

2006-04-09 Thread Fredrik Lundh
"Jay" wrote: > Now I just get this error message. > > AttributeError: 'int' object has no attribute 'image' > > But the picture appears so I am almost their. > > ---START--- > > from Tkinter import * > > class App: > def __init__(self, root): > self.MainFrame = Canvas(root) > s

Re: I wanna use urllib2 to get a page with a socks 5 proxy, who can give me a sample code ?

2006-04-09 Thread Fuzzyman
Ju Hui wrote: > I wanna use urllib2 to get a page with a socks 5 proxy,who can give me > a sample code ? > > example, > the proxy server is :123.123.123.123 > and the port is :1080 > and the username/password is : user/pass > I want to open http://www.google.com > > how to write this kind of scri

Re: Receiving emails with attachments

2006-04-09 Thread tomer . ha
Gerard, I tried to run your code but my interpreter couldn't locate the maildocument module. Is it included in Python standart library or should I install it from other place? Thanks, Tomer -- http://mail.python.org/mailman/listinfo/python-list

Re: Decorators, Identity functions and execution...

2006-04-09 Thread Fredrik Lundh
Carl Banks wrote: > Having said that, this decorator will not affect calling overhead at > all. The decorator is applied when the module is loaded, not when the > decorated function is called. to be precise, the decorator is applied when the "def" statement is exe- cuted (that is, when the decor

Re: Programming Tutorial for absolute beginners

2006-04-09 Thread John Salerno
Clodoaldo Pinto wrote: > Duncan Smith wrote: >> But as you use conversions to float in order to avoid integer division >> in your code examples, it might be best to explain what's going on, even >> if you do have to explain the relevant types. >> > > I changed the comments in the first program tha

Re: how relevant is C today?

2006-04-09 Thread John Salerno
Martin v. Löwis wrote: > As for *learning* the languages: never learn a language without a > specific inducement. If you know you are going to write a Python > extension, an Apache module, or a Linux kernel module in the > near future, start learning C today. If you don't know what you > want to u

How Relevant is C Today? I still need it for Writing!

2006-04-09 Thread Casey Hawthorne
How Relevant is C Today? I still need it for Writing! -- Regards, Casey -- http://mail.python.org/mailman/listinfo/python-list

Re: Receiving emails with attachments

2006-04-09 Thread Tim Williams (gmail)
On 8 Apr 2006 13:24:20 -0700, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: want to develop a script which will receive emails with attachmentsfrom my POP3 account, perform certain actions on it and email it back to someone else.However, I'm not familiar with any Python library which does it. Coul

Creating an event loop

2006-04-09 Thread Fabian Steiner
Hello! I am currently wondering how to write something like an "event loop". For example, if I want to write a function that checks whether a file was added or removed in a directory I would think of a "while 1: ..." construct that checks the mtime of the directory. Is this the right way to achiev

Re: More pythonic circle?

2006-04-09 Thread Pythor
Fredrik Lundh wrote: > "Pythor" wrote: > > > > You aren't getting any benefit from numpy or python here. Are you > > > aiming for speed or legibility? > > > > > Speed will be a necessity, eventually. I was just really aiming for > > something that works, and that I am capable of writing. > > any

Re: Receiving emails with attachments

2006-04-09 Thread Gerard Flanagan
[EMAIL PROTECTED] wrote: > Gerard, > > I tried to run your code but my interpreter couldn't locate the > maildocument module. Is it included in Python standart library or > should I install it from other place? > > Thanks, > Tomer Sorry Tomer, I was just suggesting you read it through as an exam

Best Python web-hosting?

2006-04-09 Thread walterbyrd
I don't need that much web space. I don't need Zope/Plone. But, I want a site that offers more than just CGI. And I would like support for recent Python releases. Price is an issue, that's one reason I've been reluctant to use python for web-sites, hosting seems to be more expensive than with php

Re: IDLE on Fedora Core 5

2006-04-09 Thread David H Wild
In article <[EMAIL PROTECTED]>, Fredrik Lundh <[EMAIL PROTECTED]> wrote: > > I have just installed FC5 on a new computer. I can access Python by > > typing "Python" in a terminal window, but I can't find any way of > > getting to IDLE. > > > > Can anyone help? > $ yum provides idle > can help,

Re: Best Python web-hosting?

2006-04-09 Thread tellarite
http://www.westhost.com/ You get a virtual private server with them, so you can install whatever you want. cheap too. -- http://mail.python.org/mailman/listinfo/python-list

Notification bubbles via dbus in Gnome on Ubuntu.

2006-04-09 Thread Neil Woolford
I'd like to be able to pop up a notification bubble like the ones used by Ubuntu for 'updates available' etc. In particular I'd like to be able to use them to warn users of other machines that I have started a background session for maintenance and not to worry if the computer seems to be doing th

Re: how relevant is C today?

2006-04-09 Thread Mirco Wahab
Hi John > It's just that I obessively like to learn new things, > and I keep moving on to new subjects once I've 'learned' > something well enough. Ha! So learn 'Perl' then - you'll never ever get over this point ... ;-)) And if you, against all odds, think you master it now - zon, a new P

Re: Best Python web-hosting?

2006-04-09 Thread Steve
http://www.python-hosting.com/ I haven't used them myself, but recent research that I did made them look like good candidates. -- http://mail.python.org/mailman/listinfo/python-list

Problems with current value of wx.SpinCtrl and EVT_SPIN

2006-04-09 Thread blackno666
Hello, I am new to Python/wxPython and am experiencing first problems. I have a dialog which includes a SpinCtrl and a Slider. I want the Slider to affect the SpinCtrl and vice versa (http://wiki.wxpython.org/index.cgi/ChallengeDemos#Part1). The code I wrote does, however, not work correctly. The

Re: how relevant is C today?

2006-04-09 Thread Mirco Wahab
Hi Scott your summary looks very concise and good to read. I'd like to make some minor additions, > C can express neither exceptions nor coroutines (nor their fancy cousin, > continuations), which could be and were expressed in assembly. Nor does > C provide memory management. A few library fu

Re: 32-bit python on Opteron, Solaris 10?

2006-04-09 Thread Olivier P
Gary Robinson wrote: > I'm in the market for a server to run some python code which is > optimized via psyco. > > Sun T2100 servers come with Solaris 10, which comes with python > pre-installed. You can always install a 32bits version of Linux or Solaris on the X2100 yourself. The X2100 is even

Re: Mysterious EOFError

2006-04-09 Thread Rex Eastbourne
Thanks. Do you know of a solution to this? I tried the following, which I found on this newsgroup: # lines = open(sys.argv[1]).readlines() # sys.stdin = open('/dev/tty') a = raw_input('Prompt: ') # sys.stdin = os.fdopen(3) a = raw_input('Prompt: ') #==

Re: [Newbie] Referring to a global variable inside a function

2006-04-09 Thread Ernesto García García
>>How would you do this? > > def line_action(line, match_dictionary): > global count # make it a module-global variable, not a function-local > count = count + 1 > > OK, I had put it on the global block. Thanks, Ernesto -- http://mail.python.org/mailman/listinfo/python-lis

Re: how relevant is C today?

2006-04-09 Thread David Rasmussen
Mirco Wahab wrote: > > I would say, from my own experience, that you wouldn't > use all C++ features in all C++ projects. Most people > I know would write C programs 'camouflaged' as C++, > that is: write clean & simple C - and use some C++ > features e.g, class bound methods for interfaces - > bu

Re: Calling Web Services from Python

2006-04-09 Thread m.banaouas
Can you tell us more about SOAPpy bug ? Is it about authentication ? Ivan Zuzak a écrit : >... > I need a package/tool that generates web service proxies that will do > all the low-level HTTP work. (Someting like the WSDL.EXE tool in .NET > Framework) The ZSI and SOAPy packages [1] that i found

Re: wxStyledTextCtrl - Dead?

2006-04-09 Thread blackno666
The wxPython Demo (http://prdownloads.sourceforge.net/wxpython/wxPython-demo-2.6.3.2.tar.gz) still contains the wxStyledTextCtrl: wx.stc.StyledTextCtrl The demo is probably also a good example of how to use wxStyledTextCtrl. Basic information can be found on http://www.yellowbrain.com/stc/init_r

Re: efficiency of range() and xrange() in for loops

2006-04-09 Thread Fredrik Lundh
Alan Morgan wrote: > >How would xrange(100).remove(1) work? > > One way is by first converting the xrange to a list. If we think of > the xrange as an efficient and space lean way to store certain types > of lists then it isn't unreasonable to return a regular list when > the conditions no longer

Re: "The World's Most Maintainable Programming Language"

2006-04-09 Thread Thomas Nelson
I thought the paragraph about provability was interesting. Presumably the author refers to proofs in the spirit of "A Discipline of Programming" from Djikstra, 1976. Unfortunately, I don't think anyone has writting much about this since the 70s. I'd be interested to learn if anyone's tried to wr

Re: Automated Graph Plotting in Python

2006-04-09 Thread Alexander Schmolck
[EMAIL PROTECTED] writes: > 1. Which is the best graph plotting utility in python or linux. matplotlib (provided it does the type of graphs you need, which is likely) 'as -- http://mail.python.org/mailman/listinfo/python-list

Re: Receiving emails with attachments

2006-04-09 Thread tomer . ha
Thanks! -- http://mail.python.org/mailman/listinfo/python-list

Re: How to determine if a line of python code is a continuation of the line above it

2006-04-09 Thread Leif K-Brooks
Sandra-24 wrote: > I'm not sure how complex this is, I've been brainstorming a little, and > I've come up with: from tokenize import generate_tokens, NL, NEWLINE from cStringIO import StringIO def code_lines(source): """Takes Python source code (as either a string or file-like object) a

Re: mod_python + apache + winxp => nogo

2006-04-09 Thread cyberco
Hi Jim, Thanks, I'll sign up for the mailinglist, but to finish the story here: - I only have one version of Python installed - From the Python interpreter I can import the mod_python module just fine - At starup the Apache log states: [Sun Apr 09 22:16:38 2006] [notice] Apache/2.0.55 (Win32) mod

Re: mod_python + apache + winxp => nogo

2006-04-09 Thread cyberco
yep -- http://mail.python.org/mailman/listinfo/python-list

Re: Writing files on server through CGI

2006-04-09 Thread Christoph Haas
On Sun, Apr 09, 2006 at 12:35:21AM -0700, [EMAIL PROTECTED] wrote: > I have a CGI script on server which process a form and writes its > content on a file like > fp = open(fname, 'w') > fp.write('Cool > list%s%s > > Its working fine, but will it work if the script recieves thousands of > request s

Re: Tkinter

2006-04-09 Thread Jay
Brill, Thanks for the help -- http://mail.python.org/mailman/listinfo/python-list

Re: Creating an event loop

2006-04-09 Thread Peter Hansen
Fabian Steiner wrote: > I am currently wondering how to write something like an "event loop". > For example, if I want to write a function that checks whether a file > was added or removed in a directory I would think of a "while 1: ..." > construct that checks the mtime of the directory. Is this t

Re: Problems with current value of wx.SpinCtrl and EVT_SPIN

2006-04-09 Thread Peter Hansen
blackno666 wrote: > I am new to Python/wxPython and am experiencing first problems. I have > a dialog which includes a SpinCtrl and a Slider. I want the Slider to > affect the SpinCtrl and vice versa > (http://wiki.wxpython.org/index.cgi/ChallengeDemos#Part1). > > The code I wrote does, however, n

Re: Problems with current value of wx.SpinCtrl and EVT_SPIN

2006-04-09 Thread blackno666
Yes, it "works". However buggy. When the slider is set to 0 and the up button is pressed in the SpinCtrl, the value in the SpinCtrl will be 1, but the slider will not move. There's also a discrepancy between the value displayed in the SpinCtrl and the value output by print self.spin.GetValue().

ANN: Speedometer 2.4 - bandwidth and download monitor

2006-04-09 Thread Ian Ward
Announcing Speedometer 2.4 -- Speedometer home page: http://excess.org/speedometer/ Download: http://excess.org/speedometer/speedometer.py New in this release: - New -z option treats files that don't exist as zero length so speedometer

Re: how relevant is C today?

2006-04-09 Thread John Salerno
Mirco Wahab wrote: > At which level in the 'python challenge' did > you get stuck - and why? Ugh, don't remind me! :) I'm stuck on level 12, which is yet another image processing puzzle. I'm getting tired of those, and I think it's really a shame that there is a reliance on image puzzles rathe

Re: Best Python web-hosting?

2006-04-09 Thread John Salerno
walterbyrd wrote: > I don't need that much web space. I don't need Zope/Plone. > > But, I want a site that offers more than just CGI. And I would like > support for recent Python releases. > > Price is an issue, that's one reason I've been reluctant to use python > for web-sites, hosting seems to

Re: Problems with current value of wx.SpinCtrl and EVT_SPIN

2006-04-09 Thread blackno666
Just found a solution to the problem: when using wx.EVT_SPINCTRL instead of wx.EVT_SPIN_UP, wx.EVT_SPIN_DOWN or wx.EVT_SPIN the program behaves correctly. wxWidget documentation for wxSpinCtrl states that "You may also use the wxSpinButton event macros, however the corresponding events will not b

Re: Decorators, Identity functions and execution...

2006-04-09 Thread Steven D'Aprano
On Sun, 09 Apr 2006 08:52:18 -0700, Carl Banks wrote: > it's more important > to respect community standards than to stick to some silly preference > you have. What happens when the community standard is a silly preference? I object to the suggestion that "community standards" (that is, a standar

Re: Decorators, Identity functions and execution...

2006-04-09 Thread Roy Smith
Steven D'Aprano <[EMAIL PROTECTED]> wrote: > On Sun, 09 Apr 2006 08:52:18 -0700, Carl Banks wrote: > > > it's more important > > to respect community standards than to stick to some silly preference > > you have. > > What happens when the community standard is a silly preference? I object > to t

Re: Decorators, Identity functions and execution...

2006-04-09 Thread Felipe Almeida Lessa
Em Dom, 2006-04-09 às 08:52 -0700, Carl Banks escreveu: > You've made the unfortunate mistake of indenting it with tabs, which > do > not show up on some newsreaders. I see the tabs in Google; people > using Microsoft Outlook do not. He does not need to know that some poor designed newsreaders m

[EMAIL PROTECTED]

2006-04-09 Thread Ahava321
please put me on your mailing list -- http://mail.python.org/mailman/listinfo/python-list

Re: More pythonic circle?

2006-04-09 Thread John Machin
It's also possible to write microprocessor assembly language in any other language. The following code generates the OP's list of points with nothing more complicated than integer addition/subtraction inside the loop. It also does the right thing if the radius is not an integer, and avoids the OP's

Re: More pythonic circle?

2006-04-09 Thread John Machin
[Michael Tobis] Also, with this code, you are using radius for the dimensions of the enclosing box, as well as the radius of the circle, so it's guaranteed to not to actually produce a whole circle. Recall what python does with negative indices! [Pythor] I'm not sure what you mean here. It produc

Re: More pythonic circle?

2006-04-09 Thread Scott David Daniels
Pythor wrote: > I wrote the following code for a personal project. I need a function > that will plot a filled circle in a two dimensional array. I found > Bresenham's algorithm, and produced this code. Please tell me there's > a better way to do this. > > import numpy > > def circle(field=Non

Re: More pythonic circle?

2006-04-09 Thread Pythor
John Machin wrote: > [Michael Tobis] > Also, with this code, you are using radius for the dimensions of the > enclosing box, as well as the radius of the circle, so it's guaranteed > to not to actually produce a whole circle. Recall what python does with > negative indices! > > [Pythor] > I'm not s

Python 3.0 or Python 3000?

2006-04-09 Thread John Salerno
Is 'Python 3000' just a code name for version 3.0, or will it really be called that when it's released? -- http://mail.python.org/mailman/listinfo/python-list

Re: Decorators, Identity functions and execution...

2006-04-09 Thread Carl Banks
Felipe Almeida Lessa wrote: > Em Dom, 2006-04-09 às 08:52 -0700, Carl Banks escreveu: > > You've made the unfortunate mistake of indenting it with tabs, which > > do > > not show up on some newsreaders. I see the tabs in Google; people > > using Microsoft Outlook do not. > > He does not need to k

a unicode question?

2006-04-09 Thread zdwang
Hello, There is a unicode string, I want to change it to ansi string. but it raise an exception. Could you help me? ## I want to change s1 to s2. s1 = u'\xd6\xd0\xb9\xfa\xca\xaf\xbb\xaf(600028) ' s2 = '\xd6\xd0\xb9\xfa\xca\xaf\xbb\xaf(600028) ' -- http://mail.python.org/mailman

Re: Decorators, Identity functions and execution...

2006-04-09 Thread Carl Banks
Steven D'Aprano wrote: > On Sun, 09 Apr 2006 08:52:18 -0700, Carl Banks wrote: > > > it's more important > > to respect community standards than to stick to some silly preference > > you have. > > What happens when the community standard is a silly preference? I object > to the suggestion that "c

  1   2   >