ANNOUNCE: Kamaelia 0.1.2 Released

2005-04-13 Thread Michael Sparks
Kamaelia 0.1.2 has been released! What is it? === Kamaelia is a collection of Axon components designed for network protocol experimentation in a single threaded, select based environment. Axon components are python generators are augmented by inbox and outbox queues (lists) for

Re: Global Variables

2005-04-13 Thread George Sakkis
Use 'global': def change_filename(): global filename filename=raw_input() def change_path(): global path path=raw_input() Even better, don't use globals at all; in 99% if the time, there are better ways to achieve the same effect. George --

Re: Python license (2.3)

2005-04-13 Thread Antoon Pardon
Op 2005-04-12, Robert Kern schreef [EMAIL PROTECTED]: Antoon Pardon wrote: What licence can I use? Somewhere they say you can combine python code with GPL code. Does that mean that the resulting code has to have both the GPL license as the PSF license, as both seem to want that derived work

win32 readline maintenance (was Re: IPython - problem with...

2005-04-13 Thread Ville Vainio
Fernando == Fernando Perez [EMAIL PROTECTED] writes: Fernando Bummer. I wonder, if the changes are minor and easy, Fernando perhaps you (or someone else) could offer Gary to take Fernando over maintenance of readline/win32? It sounds Someone on the ipython mailing list already had

Re: Python license (2.3)

2005-04-13 Thread Robert Kern
Antoon Pardon wrote: Op 2005-04-12, Robert Kern schreef [EMAIL PROTECTED]: Antoon Pardon wrote: What licence can I use? Somewhere they say you can combine python code with GPL code. Does that mean that the resulting code has to have both the GPL license as the PSF license, as both seem to want

Re: PyChart into web site error

2005-04-13 Thread Michele Petrazzo
Lee Harr wrote: On 2005-04-12, Michele Petrazzo [EMAIL PROTECTED] wrote: I'm using PyChart like a module for create charts into a little web site, but when I try to create one, I have this error: /var/www/html/lgt/draw.py:19, in draw: can = canvas.init(self.file_name)

Re: Doubt regarding sorting of a list specific field

2005-04-13 Thread Steven Bethard
praba kar wrote: I have doubt regarding sorting. I have a list that list have another list (eg) list = [[1234,'name1'],[2234,'name2'],[0432,'name3']] I want to sort only numeric value having array field. How I need to do for that. In Python 2.4: py import operator py seq =

Re: Web Application Client Module

2005-04-13 Thread Berislav Lopac
Raffi wrote: Hi All, I hope I'm posting this question to the correct newsgroups. We have a web based database application that's accessed using IE. The application opens a popup window to run in. With all the popup blockers and compromised browsers out there, I'm looking into developing a

Re: Doubt regarding sorting of a list specific field

2005-04-13 Thread F. Petitjean
Le Wed, 13 Apr 2005 01:13:40 -0600, Steven Bethard a écrit : praba kar wrote: list = [[1234,'name1'],[2234,'name2'],[0432,'name3']] I want to sort only numeric value having array field. How I need to do for that. In Python 2.4: py import operator py seq =

Re: Doubt regarding sorting of a list specific field

2005-04-13 Thread Steven Bethard
vincent wehren wrote: praba kar [EMAIL PROTECTED] schrieb im Newsbeitrag news:[EMAIL PROTECTED] | Dear All, | |I have doubt regarding sorting. I have a list | that list have another list (eg) | | list = [[1234,'name1'],[2234,'name2'],[0432,'name3']] - Be careful, 0432 is octal notation for

Re: Doubt regarding sorting of a list specific field

2005-04-13 Thread Steven Bethard
F. Petitjean wrote: Le Wed, 13 Apr 2005 01:13:40 -0600, Steven Bethard a écrit : praba kar wrote: list = [[1234,'name1'],[2234,'name2'],[0432,'name3']] I want to sort only numeric value having array field. How I need to do for that. In Python 2.4: py import operator py seq =

Re: win32 readline maintenance (was Re: IPython - problem with...

2005-04-13 Thread Michele Simionato
Switching to the US keyboard did not help for me. -- http://mail.python.org/mailman/listinfo/python-list

Re: Doubt regarding sorting of a list specific field

2005-04-13 Thread Steven Bethard
Steven Bethard wrote: See my other post in this thread. seq.sort() is not stable; Hmmm... That didn't come out right. list.sort *is* stable. It's just that if you want to sort only by the first element of each tuple in a list, then list.sort won't produce results that are stable under this

Re: Python license (2.3)

2005-04-13 Thread Antoon Pardon
Op 2005-04-13, Robert Kern schreef [EMAIL PROTECTED]: Antoon Pardon wrote: Op 2005-04-12, Robert Kern schreef [EMAIL PROTECTED]: Antoon Pardon wrote: What licence can I use? Somewhere they say you can combine python code with GPL code. Does that mean that the resulting code has to have both

Re: [perl-python] Python documentation moronicities (continued)

2005-04-13 Thread bruno modulix
Ivan Van Laningham wrote: Hi All-- Richie Hindle wrote: [Xah] motherfucking ... fucking ... fucking ... fucking ... fuck ... fucking fucking ... fucking ... mother fucking ... fucking ... piece of shit ... motherfucking ... fucking ... fucking ... big asshole ... masturbation ... Fucking morons

Re: Python documentation moronicities (continued)

2005-04-13 Thread Fredrik Lundh
runes [EMAIL PROTECTED] wrote: I found the Howto through Google. Somehow I didn't see that link in the documentation. And please do not make any assumptions about my reading of manuals. if you were unable to find a link in the documentation you were reading, can you perhaps suggest a better

email: Content-Disposition and linebreaks with long filenames

2005-04-13 Thread Martin Krner
Hi NG, I am using email module for creating mails with attachment (and then sending via smtplib). If the name of the attachment file is longer than about 60 characters the filename is wrapped in the Content-Disposition header: Content-Disposition: attachment; filename=This is a sample

A command in a String ?

2005-04-13 Thread Peter Moscatt
I have a rather odd question: Is there a way Python can execute a command within a string ? For example if I had something like: _str = fm=OptionMenu(root,xx,'string1','string2','string3') And the execute _str. The reason why I am trying to do this that as I am aware the OptionMenu hasn't the

Re: A command in a String ?

2005-04-13 Thread Fredrik Lundh
Peter Moscatt wrote: I have a rather odd question: Is there a way Python can execute a command within a string ? For example if I had something like: _str = fm=OptionMenu(root,xx,'string1','string2','string3') And the execute _str. exec _str The reason why I am trying to do this that as

Re: Looking for a very specific type of embedded GUI kit

2005-04-13 Thread Frithiof Andreas Jensen
Sizer [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] So the question is: what non-X gui toolkit can we use that has Python bindings and will let us use a custom display driver at the lowest level? There is a discussion of Embedded X's here:

Re: A command in a String ?

2005-04-13 Thread Tim Daneliuk
Peter Moscatt wrote: I have a rather odd question: Is there a way Python can execute a command within a string ? For example if I had something like: _str = fm=OptionMenu(root,xx,'string1','string2','string3') And the execute _str. The reason why I am trying to do this that as I am aware the

Re: A command in a String ?

2005-04-13 Thread Peter Moscatt
/F, Thanks for the help on this. Yea the 'exec' did the trick. The second example just placed all the strings in one option button. Pete On Wed, 13 Apr 2005 10:34:20 +0200, Fredrik Lundh wrote: Peter Moscatt wrote: I have a rather odd question: Is there a way Python can execute a

Compute pi to base 12 using Python?

2005-04-13 Thread Dick Moores
I need to figure out how to compute pi to base 12, to as many digits as possible. I found this reference, http://mathworld.wolfram.com/Base.html, but I really don't understand it well enough. Could someone show me how to do what I need? Thanks, Dick Moores [EMAIL PROTECTED] --

Re: A command in a String ?

2005-04-13 Thread Fredrik Lundh
Peter Moscatt wrote: strings = string1, string2, string3 fm = OptionMenu(root, xx, *strings) Thanks for the help on this. Yea the 'exec' did the trick. The second example just placed all the strings in one option button. did you include the asterisk? if you remove that, you get

Re: Python license (2.3)

2005-04-13 Thread Robert Kern
Antoon Pardon wrote: Op 2005-04-13, Robert Kern schreef [EMAIL PROTECTED]: Yes, the license text and the copyright notice must be attached. It doesn't mean that the PSF license is the operative one for the derivative work. Why attach a license that is not operative. That doesn't make sense to

Re: A command in a String ?

2005-04-13 Thread Peter Otten
Peter Moscatt wrote: Thanks for the help on this.  Yea the 'exec' did the trick. The second example just placed all the strings in one option button. Peter, you most certainly do *not* need an exec statement. If you take the time to explain what you want to do (as opposed to how you want to do

Re: Python license (2.3)

2005-04-13 Thread Antoon Pardon
Op 2005-04-13, Robert Kern schreef [EMAIL PROTECTED]: Antoon Pardon wrote: Op 2005-04-13, Robert Kern schreef [EMAIL PROTECTED]: Yes, the license text and the copyright notice must be attached. It doesn't mean that the PSF license is the operative one for the derivative work. Why attach

Re: A command in a String ?

2005-04-13 Thread Peter Moscatt
/F, No, I hadn't included the '*' Ya learn something every day. Pete On Wed, 13 Apr 2005 11:07:13 +0200, Fredrik Lundh wrote: Peter Moscatt wrote: strings = string1, string2, string3 fm = OptionMenu(root, xx, *strings) Thanks for the help on this. Yea the 'exec' did the

Re: email: Content-Disposition and linebreaks with long filenames

2005-04-13 Thread André Malo
* Martin Körner [EMAIL PROTECTED] wrote: I am using email module for creating mails with attachment (and then sending via smtplib). If the name of the attachment file is longer than about 60 characters the filename is wrapped in the Content-Disposition header: Content-Disposition:

how to explain such codes, python's bug or mine?

2005-04-13 Thread MaHahaXixi
j = range(20) print j [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19] for k in j: if k = 10: j.remove(k) print j [1, 3, 5, 7, 9, 11, 12, 13, 14, 15, 16, 17, 18, 19] Python 2.3.4 (#53, May 25 2004, 21:17:02) [MSC v.1200 32 bit (Intel)] on win32 Type copyright,

Re: numarray.array can be VERY slow

2005-04-13 Thread Jim
Edward C. Jones wrote: Steven Bethard wrote: As mentioned, this has nothing to do with numarray, and everything to do with your inexplicable use of lists. Why don't you just write this as: arr = numarray.ones((8, 8, 256, 256), Float64) The code I posted was simplified from a larger

Re: how to explain such codes, python's bug or mine?

2005-04-13 Thread [EMAIL PROTECTED]
Hi, it is not python bug. You refer the list j and remove the element in the same time, that is the problem. Python dinamicaly goes to the next element with the same index but apply it in the new list. use this code instead: j = range(20) print j L = [x for x in j if x 10] print L

Re: Compute pi to base 12 using Python?

2005-04-13 Thread Bengt Richter
On Wed, 13 Apr 2005 02:06:11 -0700, Dick Moores [EMAIL PROTECTED] wrote: I need to figure out how to compute pi to base 12, to as many digits as possible. I found this reference, http://mathworld.wolfram.com/Base.html, but I really don't understand it well enough. Could someone show me how to

Re: HTTPSConnection script fails, but only on some servers (long)

2005-04-13 Thread andreas
Well HTTPSConnection does not support proxies. (HTTP/CONNECT + switch to HTTPS) And it hasn't ever. Although the code seems to make sense there is no support for handling that switch. Probably a good thing to complain about (file a new bug report). In the meantime you should take a look a cURL

Re: Programming Language for Systems Administrator

2005-04-13 Thread Ville Vainio
beliavsky == beliavsky [EMAIL PROTECTED] writes: beliavsky The key difference between the Unix approach and the beliavsky MSH one is that rather than creating a pipeline based beliavsky on textual input and output, MSH passes data between beliavsky the various commandlets as

Re: how to explain such codes, python's bug or mine?

2005-04-13 Thread Jim
MaHahaXixi wrote: j = range(20) print j [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19] for k in j: if k = 10: j.remove(k) print j [1, 3, 5, 7, 9, 11, 12, 13, 14, 15, 16, 17, 18, 19] Python 2.3.4 (#53, May 25 2004, 21:17:02) [MSC v.1200 32 bit (Intel)] on win32 Type

Re: Compute pi to base 12 using Python?

2005-04-13 Thread Dick Moores
Bengt Richter wrote at 03:19 4/13/2005: On Wed, 13 Apr 2005 02:06:11 -0700, Dick Moores [EMAIL PROTECTED] wrote: I need to figure out how to compute pi to base 12, to as many digits as possible. I found this reference, http://mathworld.wolfram.com/Base.html, but I really don't understand it well

for line in file weirdness

2005-04-13 Thread Cordula's Web
Hello, here's a strange bug (?) I've came across (using Python 2.2): # loop_1 for line in file: if some_condition(line): break do_something() # loop_2 for line in file: do_something_else() The problem is, that loop_2 doesn't resume where loop_1 left off, but skips many lines (a

Re: Compute pi to base 12 using Python?

2005-04-13 Thread Roman Neuhauser
# [EMAIL PROTECTED] / 2005-04-13 03:27:06 -0700: Bengt Richter wrote at 03:19 4/13/2005: This is not homework, nor am I a student, though I am trying to learn Python. I'm just trying to help an artist acquaintance who needs (I just learned) the first 3003 digits of pi to the base 12.

Re: Python documentation moronicities (continued)

2005-04-13 Thread runes
Seems like criticising the manual is som kind of heresy. So be it. You know, the Re documentation contains many pages. Ufortunately I didn't dwell with the first introductory paragraph, I was trying to solve a particular problem. I'm not that used to looking for links to external sources in the

Re: how to explain such codes, python's bug or mine?

2005-04-13 Thread [EMAIL PROTECTED]
Hi The second style can be used: j = range(20) print j L = [x for x in j if x 10] j = L There are another method such poping the item based on last index to 0: for i in range(len(j)-1,0-1,-1): if j[i]=10: j.pop(i) print j Pujo --

Re: args attribute of Exception objects

2005-04-13 Thread Sebastien de Menten
Did I misunderstand the problem again? Hmmm, yes ! But I think I am not expressing clearly my concern :-) So my problem is that default exception are badly designed in their use of their args attribute. I know it is possible to subclass Exception as every object and add the attributes I want

Re: Compute pi to base 12 using Python?

2005-04-13 Thread Dan Bishop
Dick Moores wrote: I need to figure out how to compute pi to base 12, to as many digits as possible. I found this reference, http://mathworld.wolfram.com/Base.html, but I really don't understand it well enough. How many stars are in *? You probably answered 25. This

Re: Python documentation moronicities (continued)

2005-04-13 Thread Steve Holden
runes wrote: Seems like criticising the manual is som kind of heresy. So be it. Don't think so, but this being open source I suspect that Fredrik was trying to get them improved. You know, the Re documentation contains many pages. Ufortunately I didn't dwell with the first introductory

Re: Programming Language for Systems Administrator

2005-04-13 Thread Uwe Grauer
Kanthi Kiran Narisetti wrote: Hi All, Thank You for your suggestionsI request you all to eloborate the Uses(In Practical) for systems administrator.Some of my questions regarding the same follows. 1)Can i build web applications in Python ? If so how. I am planning to build a web

Re: os.path.walk

2005-04-13 Thread Steve Holden
Tony Meyer wrote: If I have os.path.walk(name, processDirectory, None) and processDirectory needs three arguments how can I ass them because walk only takes 3? Assuming that processDirectory is a function of yours that returns a bool, then you'd do something like: os.path.walk(name,

Re: Northampton, UK

2005-04-13 Thread Fuzzyman
Martin Franklin wrote: Fuzzyman wrote: Just on the off chance I thought I'd ask if there were any Pythoneers out there local to Northampton UK ? Best Regards, Fuzzy http://www.voidspace.org.uk/python I'm just over the border (Bedfordshire) but like a lot of people commute

Re: how to explain such codes, python's bug or mine?

2005-04-13 Thread MaHahaXixi
yes. i think it does so. it take me the whole afternoon to find out the bug (mine) i change: for i in range(len(j) -1, -1, -1): d = j[i] if d = 10: j.remove(d) the real code is not so simple,so j[11:] will not work for me. but, i think phthon could found that i remove the current

Has Python 2.4.1 changed implementation for __init__.py???

2005-04-13 Thread Werner Merkl
Hallo, I just downloaded http://www.python.org/pypi/xexpr/0.02, installed if (python setup.py install) and tried the example in the README file. Than I got following error: AttributeError: 'module' object has no attribute 'Read' This is same behavior for all module using empty __init__.pr files,

Re: Compute pi to base 12 using Python?

2005-04-13 Thread Dick Moores
Dan Bishop wrote at 04:07 4/13/2005: (3) A function for converting numbers to their base-12 representation. For integers, this can be done with: DIGITS = 0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ def itoa(num, radix=10): is_negative = False if num 0: is_negative = True num = -num

Re: for line in file weirdness

2005-04-13 Thread Fredrik Lundh
Cordula's Web [EMAIL PROTECTED] wrote: here's a strange bug (?) I've came across (using Python 2.2): # loop_1 for line in file: if some_condition(line): break do_something() # loop_2 for line in file: do_something_else() The problem is, that loop_2 doesn't resume where loop_1

Re: Has Python 2.4.1 changed implementation for __init__.py???

2005-04-13 Thread Fredrik Lundh
Werner Merkl wrote: I just downloaded http://www.python.org/pypi/xexpr/0.02, installed if (python setup.py install) and tried the example in the README file. Than I got following error: AttributeError: 'module' object has no attribute 'Read' This is same behavior for all module using

Re: for line in file weirdness

2005-04-13 Thread SamIam
I think what you need to do is to have a nested if_else statment: for line in filelines: if some_condition : break else: do_something_else If the if statment is excuted then break return to for_loop else do something different then return to for_loop. When I read from a file I

terminate exectutioin in PythonWin

2005-04-13 Thread Jim
Hi all 1.Could someone tell me how to terminate execution in PythonWin? 2.Can anyone recommend a free development environment in which you can save your workspace (e.g. open files, debugging breakpoints etc.) Jim -- http://mail.python.org/mailman/listinfo/python-list

Re: [perl-python] Python documentation moronicities (continued)

2005-04-13 Thread Sibylle Koczian
Pokerface schrieb: Gotta say, is we let this man write the docs for us, they'll sure as sugar be more colorful than the ones we presently have, even if he doesn't manage to make them better. The [insert relation]ing Python interpreter is usually installed as /usr/local/bin/python on those

Re: Has Python 2.4.1 changed implementation for __init__.py???

2005-04-13 Thread Werner Merkl
Fredrik Lundh wrote: Werner Merkl wrote: I just downloaded http://www.python.org/pypi/xexpr/0.02, installed if (python setup.py install) and tried the example in the README file. Than I got following error: AttributeError: 'module' object has no attribute 'Read' This is same behavior for all

Re: how to explain such codes, python's bug or mine?

2005-04-13 Thread Fredrik Lundh
MaHahaXixi [EMAIL PROTECTED] wrote: for python, i am a newbie, but i did not found the warning of such usage from the python tutorial 4.2 for Statements It is not safe to modify the sequence being iterated over in the loop (this can only happen for mutable sequence types, such as

Re: terminate exectutioin in PythonWin

2005-04-13 Thread Larry Bates
1) To exit any application: import sys sys.exit(0) 2) I'm not familiar with any of these development systems. I use what comes with ActiveState's PythonWin. It does have debugging breakpoints, etc. Larry Bates Jim wrote: Hi all 1.Could someone tell me how to terminate execution in

Re: Python documentation moronicities (continued)

2005-04-13 Thread rbt
runes wrote: Generally: I have got my experiences with the Python Manual over the the last 30 months Python beeing my preferred language. One of them is that I have to look elsewhere. I've gotten great help from this newsgroup. By following these steps: 1. Read the docs at

Re: Compute pi to base 12 using Python?

2005-04-13 Thread Roy Smith
In article [EMAIL PROTECTED], Dan Bishop [EMAIL PROTECTED] wrote: But there's no reason other than tradition why you should arrange them into groups of 10. Well, it is traditional for people to have 10 fingers :-) Other fun things to think about are negative bases. For example, 3(10) =

Re: terminate exectutioin in PythonWin

2005-04-13 Thread Jim
Larry Bates wrote: 1) To exit any application: import sys sys.exit(0) ... Thanks Larry. Actually I meant how do I stop a program running that I have started in the interpreter. If I get into an infinite loop I can't stop it without qutting PythonWin. Then I have to open all the files and

preallocate list

2005-04-13 Thread Jim
Hi all Is this the best way to preallocate a list of integers? listName = range(0,length) What about non integers? I've just claimed in the newsgroup above that pre-allocating helps but I might be getting confused with matlab ;) If I have a file with a floating point number on each line, what is

Re: Python 2.4 killing commercial Windows Python development ?

2005-04-13 Thread Robin Becker
Raymond Hettinger wrote: [Robin Becker] People have mentioned the older v6 build scripts/tools still work. Last time I tried they seemed a bit out of date. I routinely use the current CVS to build Py2.4 and Py2.5 with MSC6. It is effortless and I've had no problems. Raymond Hettinger I

Re: Python 2.4 killing commercial Windows Python development ?

2005-04-13 Thread Peter Hansen
Peter Hansen wrote: The last I recall reading in this forum was that the regular distribution is compiled with a copy of the compiler *provided by* Microsoft. On re-reading, I see this might not be clear enough. By 'provided by' I meant *donated by*, as in given free (apparently) to the PSF or at

Re: os.path.walk

2005-04-13 Thread Peter Hansen
Micheal wrote: If I have os.path.walk(name, processDirectory, None) and processDirectory needs three arguments how can I ass them because walk only takes 3? The best answer to this is: if you aren't stuck using a version of Python prior to 2.4, don't use os.path.walk but use os.walk() instead...

isbntools. (python script to download book informaiton)

2005-04-13 Thread paul
Hello, I am trying to make up a catalogue of my books. I found tools on isbntools.com in python. YAY i thought. Something happens! But I cant seem to get the part to download the books information from amazon.com working correctly. It connects, but I think the regular expressions used in the

Is socket.shutdown(1) useless

2005-04-13 Thread pyguy2
Issues of socket programming can be wierd, so I'm looking for some comments. In my python books I find exclusive use of socket.close(). From my other readings, I know about a partial close operation. So, I figured it would be useful to post some code about how socket.close() has an implicit send

Re: preallocate list

2005-04-13 Thread rbt
Jim wrote: If I have a file with a floating point number on each line, what is the best way of reading them into a list (or other ordered structure)? I was iterating with readline and appending to a list but it is taking ages. Perhaps you should use readlines (notice the s) instead of readline.

Re: preallocate list

2005-04-13 Thread Bill Mill
On 4/13/05, Jim [EMAIL PROTECTED] wrote: Hi all Is this the best way to preallocate a list of integers? listName = range(0,length) the 0 is unnecessary; range(length) does the same thing. What about non integers? arr = [myobject() for i in range(length)] I've just claimed in the

Re: printing with wxPython

2005-04-13 Thread Fabio Pliger
Yeah, There are two about printing... there is also an example in the wxDemo... but they all talk about printing text... In my case i need to print (or at least to make a print preview) a bitmap (or a panel...) Peter Hansen [EMAIL PROTECTED] ha scritto nel messaggio news:[EMAIL PROTECTED] Fabio

Re: preallocate list

2005-04-13 Thread Jim
rbt wrote: Jim wrote: If I have a file with a floating point number on each line, what is the best way of reading them into a list (or other ordered structure)? I was iterating with readline and appending to a list but it is taking ages. Perhaps you should use readlines (notice the s) instead

Re: preallocate list

2005-04-13 Thread Bill Mill
Just a correction: snip I would profile your app to see that it's your append which is taking ages, but to preallocate a list of strings would look like: [This is an average length string for i in range(approx_length)] My guess is that it won't help to preallocate, but time it and let us

Re: preallocate list

2005-04-13 Thread Jim
Thanks for the suggestions. I guess I must ensure that this is my bottle neck. code def readFactorsIntoList(self,filename,numberLoads): factors = [] f = open(self.basedir + filename,'r') line = f.readline() tokens = line.split() columns = len(tokens)

Re: database in python ?

2005-04-13 Thread Terry Hancock
On Tuesday 12 April 2005 04:54 pm, Pierre-Frédéric Caillaud wrote: Speaking of the manual, the mysql manual is quite... well... i don't quite find the word, but it has many sentences which sound like PR stuff. Like, we don't do this like you or anyone would expect, but there is a

Re: preallocate list

2005-04-13 Thread Mike C. Fletcher
Jim wrote: Thanks for the suggestions. I guess I must ensure that this is my bottle neck. ... for line in f: factor = [] tokens = line.split() for i in tokens: factor.append(float(i))

Re: terminate exectutioin in PythonWin

2005-04-13 Thread Neil Hodgson
Jim, 1.Could someone tell me how to terminate execution in PythonWin? Use the Break into running code command on the context menu of the PythonWin icon in the bottom right of the taskbar. Neil -- http://mail.python.org/mailman/listinfo/python-list

Re: terminate exectutioin in PythonWin

2005-04-13 Thread Jim
Neil Hodgson wrote: Jim, 1.Could someone tell me how to terminate execution in PythonWin? Use the Break into running code command on the context menu of the PythonWin icon in the bottom right of the taskbar. Neil Great thanks! PythonWin isn't hot on keyboard shortcuts but ironically

Re: Scanner Access in Python

2005-04-13 Thread Fredrik Lundh
GMane Python wrote: I was hoping for a bit of advise. I wanted to know if anyone has any experience with scanning. I'm mostly using Windows. I tried quickly the pyTwain, but haven't gotten too far with that. I'm not sure if scanner access is built-in to other packages, such as maybe PIL

Re: sort of a beginner question about globals

2005-04-13 Thread fred.dixon
I want to use OPTIONS as a global var. In this particular case I am trying to set a global debug constant so I can have some debug logging happen when my program is run with a -debug option. what will actuall end up in OPTIONS is OPTIONS.debug = True as i am using optparse module. --

Re: preallocate list

2005-04-13 Thread peufeu
what about : factors = [map(float, line.split()) for line in file] should be a hell of a lot faster and nicer. for line in f: factor = [] tokens = line.split() for i in tokens: factor.append(float(i))

Re: Compute pi to base 12 using Python?

2005-04-13 Thread Dan Bishop
Dick Moores wrote: Dan Bishop wrote at 04:07 4/13/2005: ... For a floating-point number x, the representation with d decimal places count be found by taking the representation of int(round(x * radix ** d)) and inserting a . d places from the right. But I'm sorry, but I can't follow you. I do

Re: sort of a beginner question about globals

2005-04-13 Thread Steven Bethard
fred.dixon wrote: I want to use OPTIONS as a global var. In this particular case I am trying to set a global debug constant so I can have some debug logging happen when my program is run with a -debug option. what will actuall end up in OPTIONS is OPTIONS.debug = True as i am using optparse

Re: os.path.walk

2005-04-13 Thread Steven Bethard
Peter Hansen wrote: Micheal wrote: If I have os.path.walk(name, processDirectory, None) and processDirectory needs three arguments how can I ass them because walk only takes 3? The best answer to this is: if you aren't stuck using a version of Python prior to 2.4, don't use os.path.walk but use

Re: database in python ?

2005-04-13 Thread Steve Holden
Terry Hancock wrote: [...] That's interesting. Most sources I've read seemed to suggest that postgresql is slower than MySQL, at least for modest size tables. There must, I suppose, be some turnover point on the size of the database? Or are you arguing that postgresql is now faster than MySQL

Codig style: or

2005-04-13 Thread Sara Khalatbari
Hi! Suppose you're writing a module writing the definition of each function in that module in or . for example: a) This function does this that or: b) This function does blah blah blah What are the differences between and ? I'm using gedit I wanna know a bit about coding style. To be

A Question About Handling SIGINT With Threads

2005-04-13 Thread Keith
I got this to work, but was hoping there was a better way. I was hoping that I wouldn't have to use globals. I wouldn't doubt that I could be totally off in what I am doing. Here is some psuedo-code of what I did: def main_thread(): # Don't know how to get rid of these guys global

Re: preallocate list

2005-04-13 Thread Steven Bethard
Jim wrote: Thanks for the suggestions. I guess I must ensure that this is my bottle neck. code def readFactorsIntoList(self,filename,numberLoads): factors = [] f = open(self.basedir + filename,'r') line = f.readline() tokens = line.split() columns =

Re: sort of a beginner question about globals

2005-04-13 Thread fred.dixon
how would i use the following if OPTIONS was in a module ? --- from optparse import OptionParser usage = usage: %prog [options] arg parser = OptionParser(usage) parser.add_option(-d, --debug, ction=store_true, dest=verbose) (OPTIONS = parser.parse_args() ps Im not anywhere

Re: terminate exectutioin in PythonWin

2005-04-13 Thread Steve Holden
Jim wrote: [...] Actually I meant how do I stop a program running that I have started in the interpreter. If I get into an infinite loop I can't stop it without qutting PythonWin. Then I have to open all the files and re-insert breakpoints etc. :( Jim Look in the system tray! Right-mouse on

Re: Codig style: or

2005-04-13 Thread Roy Smith
Sara Khalatbari [EMAIL PROTECTED] wrote: What are the differences between and ? The triple-quote form lets you write multi-line quoted strings: This function does a lot of neat stuff. It takes many lines of text to describe what it does. Multiple paragraphs, even. To be very honest: I

Re: Is socket.shutdown(1) useless

2005-04-13 Thread Steven Bethard
[EMAIL PROTECTED] wrote: In my python books I find exclusive use of socket.close(). From my other readings, I know about a partial close operation. So, I figured it would be useful to post some code about how socket.close() has an implicit send in it and you can actually gain some clarity by being

Re: Codig style: or

2005-04-13 Thread Will McGugan
Sara Khalatbari wrote: Hi! Suppose you're writing a module writing the definition of each function in that module in or . for example: a) This function does this that or: b) This function does blah blah blah What are the differences between and ? I'm using gedit I wanna know a bit about

Re: Codig style: or

2005-04-13 Thread Bill Mill
On 4/13/05, Sara Khalatbari [EMAIL PROTECTED] wrote: Hi! Suppose you're writing a module writing the definition of each function in that module in or . for example: a) This function does this that or: b) This function does blah blah blah What are the differences between and ?

Kamaelia 0.1.2 Released

2005-04-13 Thread Michael Sparks
Kamaelia 0.1.2 has been released! What is it? === Kamaelia is a collection of Axon components designed for network protocol experimentation in a single threaded, select based environment. Axon components are python generators are augmented by inbox and outbox queues (lists) for

RE: Codig style: or

2005-04-13 Thread Harper, Gina
Try PEP 8, Guido's Style Guide: http://www.python.org/peps/pep-0008.html Good luck with your boss! *gina* -Original Message- From: Sara Khalatbari [mailto:[EMAIL PROTECTED] Sent: Wednesday, April 13, 2005 11:13 AM To: Python List Subject: Codig style: or Hi! Suppose you're writing

Re: database in python ?

2005-04-13 Thread peufeu
postgresql is slower than MySQL, at least for modest size tables. There must, I When not using transactions, MySQL will blow away postgres in INSERT/UPDATE speed until the concurrency gets up a bit and the readers block writers strategy used by MyISAM starts to show its weaknesses. This is

Re: for line in file weirdness

2005-04-13 Thread Cordula's Web
A read-ahead buffer? Yes, that would explain it. Sorry, I missed this piece of information in the documentation. Thanks to all who replied. -- http://mail.python.org/mailman/listinfo/python-list

Re: preallocate list

2005-04-13 Thread Jim
Steven Bethard wrote: Jim wrote: Thanks for the suggestions. I guess I must ensure that this is my bottle neck. code def readFactorsIntoList(self,filename,numberLoads): factors = [] f = open(self.basedir + filename,'r') line = f.readline() tokens = line.split()

Re: sort of a beginner question about globals

2005-04-13 Thread Steven Bethard
fred.dixon wrote: how would i use the following if OPTIONS was in a module ? --- from optparse import OptionParser usage = usage: %prog [options] arg parser = OptionParser(usage) parser.add_option(-d, --debug, ction=store_true, dest=verbose) (OPTIONS = parser.parse_args() Just

Re: Codig style: or

2005-04-13 Thread Steven Bethard
Sara Khalatbari wrote: Hi! Suppose you're writing a module writing the definition of each function in that module in or . for example: a) This function does this that or: b) This function does blah blah blah What are the differences between and ? I'm using gedit I wanna know a bit about

  1   2   3   >