Re: HTML FORM AND PYTHON

2008-06-15 Thread subhabrata . iisc
Hi Diez, Thanx for the suggestion. I am checking if anything helpful I can find there. Regards, Subhabrata. Diez B. Roggisch wrote: > [EMAIL PROTECTED] schrieb: > > Dear Members of the group, > > I have a small question, if you can help me to find the answer. > > I have one function: > > def add_s

Re: NoneType Error

2008-06-15 Thread Gabriel Genellina
En Sun, 15 Jun 2008 05:35:18 -0300, Maryam Saeedi <[EMAIL PROTECTED]> escribió: > I am using a python program on a lot of different documents and for few of > them I will get NoneType error. I just want to skip those files and continue > for others, I do this without a problem for > IndexError,Typ

Re: Decimals in python

2008-06-15 Thread Aidan
[EMAIL PROTECTED] wrote: Hello. New to using Python. Python automatically round off watver i calculate using the floor function. How wud i make the exact value appear? Tried out fabs() in the math library but still confused. Cud some1 elaborate on it. If you're working with integers, the resul

Re: os.walk Value Error?

2008-06-15 Thread Gabriel Genellina
En Sat, 14 Jun 2008 19:06:16 -0300, <[EMAIL PROTECTED]> escribió: > I'm using os.walk as follows: > > (basedir, pathnames, files) = os.walk("results", topdown=True) > > and I'm getting the error: > > ValueError: too many values to unpack > >> From my googling, that means: > > This is the standard

Re: newbie question: for loop within for loop confusion

2008-06-15 Thread Paul Hankin
On Jun 16, 2:35 pm, takayuki <[EMAIL PROTECTED]> wrote: > def hasnolet2(avoid): >         fin = open('animals.txt') >         for line in fin: >                 word = line.strip() > >         length = len(avoid) >         x = 0 >         noprint = 0 > >         while length -1 >= x: >            

Decimals in python

2008-06-15 Thread arslanburney
Hello. New to using Python. Python automatically round off watver i calculate using the floor function. How wud i make the exact value appear? Tried out fabs() in the math library but still confused. Cud some1 elaborate on it. -- http://mail.python.org/mailman/listinfo/python-list

Re: newbie question: for loop within for loop confusion

2008-06-15 Thread takayuki
Thanks to everyone for the excellent advice. Roy: I did as you suggested and could see after staring at the output for awhile what was going on. The print statements really helped to put a little light on things. Yes, I agree that "learning to fish" is the best way. John: There were two "inchwo

Re: Hard to understand 'eval'

2008-06-15 Thread Gabriel Genellina
En Sat, 14 Jun 2008 05:31:35 -0300, TheSaint <[EMAIL PROTECTED]> escribió: > It seems to be strange that give me syntax error inside an eval statement. > I'm looking at it carefully but I can't see any flaw. > > Here it's part of the code: > > for nn in stn_items: > value= eval('cp

Samsung SyncMaster 940 NW Monitors

2008-06-15 Thread Ayushi Mehra
Samsung SyncMaster 940 NW Monitors inch, LCD, Colour monitor consumes 38 watts of power per hour, has digital user controls and a maximum resolution of 1280x1024 dpi. The screen is flat with anti-glare and anti-static coating. Its other features like MagicTune, MagicBright and MagicSpeed. It is a w

Extrapolation In Gnuplot

2008-06-15 Thread arslanburney
How would u extrapolate/ extend a given line in gnu plot? -- http://mail.python.org/mailman/listinfo/python-list

Re: A package import question

2008-06-15 Thread Gabriel Genellina
En Fri, 13 Jun 2008 22:38:24 -0300, Dan Yamins <[EMAIL PROTECTED]> escribió: >> Gabriel, thanks. I understood about the fact that import only loads the > first time, but didn't realize that "del" only removes the bound reference > to the object, not as I had hoped the thing from the namespace its

: Dell E198WFP Monitors

2008-06-15 Thread Ayushi Mehra
Dell E198WFP Monitors17-inch, LCD, Colour monitor consumes 38 watts of power per hour, has digital user controls and a maximum resolution of 1280x1024 dpi. The screen is flat with anti-glare and anti-static coating. Its other features like MagicTune, MagicBright and MagicSpeed. It is a wide screen

Re: Combining music or video files?

2008-06-15 Thread Dan Upton
On Sun, Jun 15, 2008 at 11:55 PM, Jason Scheirer <[EMAIL PROTECTED]> wrote: > On Jun 15, 7:53 pm, John Salerno <[EMAIL PROTECTED]> wrote: >> Before I try this and destroy my computer :) I just wanted to see if >> this would even work at all. Is it possible to read a binary file such >> as an mp3 or

Re: Combining music or video files?

2008-06-15 Thread Jason Scheirer
On Jun 15, 7:53 pm, John Salerno <[EMAIL PROTECTED]> wrote: > Before I try this and destroy my computer :) I just wanted to see if > this would even work at all. Is it possible to read a binary file such > as an mp3 or an avi, put its contents into a new file, then read another > such file and appe

Re: newbie: for loop within for loop question

2008-06-15 Thread Calvin Spealman
The sets module is no longer needed, as we have the built-in sets type. Its even getting a literal syntax soon. As for the original problem, I agree on the homework smell. On Jun 15, 2008, at 9:31 PM, takayuki wrote: Dennis, thanks for your reply. unfortunately i accidentally posted only h

Re: newbie question: for loop within for loop confusion

2008-06-15 Thread John Salerno
takayuki wrote: inchworm inchworm P.S. Why does 'inchworm' only print twice? Or is that not the full output? -- http://mail.python.org/mailman/listinfo/python-list

Re: newbie question: for loop within for loop confusion

2008-06-15 Thread John Salerno
takayuki wrote: for letter in avoid: if letter in word: break else: print word Take the word 'dog', for example. What the above loop is doing is basically this: 1

Re: Creating a TCP/IP connection on already-networked computers

2008-06-15 Thread John Salerno
Dennis Lee Bieber wrote: The network protocols form a layered stack. The bottom of the stack is the physical connection: coax (now rare), twisted-pair (cat-5/cat-6 cable with rectangular plugs on the end), fiber optic... etc. At some level above that is the part that translates data pack

Combining music or video files?

2008-06-15 Thread John Salerno
Before I try this and destroy my computer :) I just wanted to see if this would even work at all. Is it possible to read a binary file such as an mp3 or an avi, put its contents into a new file, then read another such file and append its contents to this same new file as well, thereby making, f

Re: Making wxPython a standard module?

2008-06-15 Thread Mike Driscoll
Grant, On Jun 14, 3:43 pm, Grant Edwards <[EMAIL PROTECTED]> wrote: > On 2008-06-14, Torsten Bronger <[EMAIL PROTECTED]> wrote: > > >> I've never used any of the designers, but I agree 100% that > >> wxPython code is nasty ugly. wxPython has a very un-Pythonic > >> API that's is, IMO, difficult to

Re: newbie question: for loop within for loop confusion

2008-06-15 Thread TheSaint
On 09:23, lunedì 16 giugno 2008 takayuki wrote: > word = line.strip() Try word= line.split() and at the end of the loop add one more print to go to new line. -- Mailsweeper Home : http://it.geocities.com/call_me_not_now/index.html -- http://mail.python.org/mailman/listinfo/python-list

Re: Hard to understand 'eval'

2008-06-15 Thread TheSaint
On 05:05, 16-6- 2008 Dennis Lee Bieber wrote: >> # any number of digit followed by 0 or 1 (k or m), case insensitive > > I don't do regular expressions... and the comment doesn't help > "digit followed by 0 or 1", when 0/1 ARE digits themselves... That means either none or one letter, of whi

Re: The best way to package a Python module?

2008-06-15 Thread Ben Finney
Jean-Paul Calderone <[EMAIL PROTECTED]> writes: > >What has changed is that the tools in common use for Debian > >packaging of Python libraries have taken on the role of generating > >those per-version copies at install time. > > [EMAIL PROTECTED]:~$ ls -l /usr/lib/python2.{4,5}/site-packages/sql

Re: newbie: for loop within for loop question

2008-06-15 Thread takayuki
Dennis, thanks for your reply. unfortunately i accidentally posted only half of my question! the "real" post should be up now. my apologies. takayuki On Jun 16, 10:15 am, Dennis Lee Bieber <[EMAIL PROTECTED]> wrote: > On Sun, 15 Jun 2008 17:18:54 -0700 (PDT), takayuki > <[EMAIL PROTECTED]> d

Re: newbie question: for loop within for loop confusion

2008-06-15 Thread Roy Smith
In article <[EMAIL PROTECTED]>, takayuki <[EMAIL PROTECTED]> wrote: > Hi, > > I'm studying python via the exellent book "How to think like a python > programmer" by Allen Downey. > > Noob question follows... > > animals.txt is a list of animals, each on a separate line: "aardvard, > bat, cat,

newbie question: for loop within for loop confusion

2008-06-15 Thread takayuki
Hi, I'm studying python via the exellent book "How to think like a python programmer" by Allen Downey. Noob question follows... animals.txt is a list of animals, each on a separate line: "aardvard, bat, cat, dog, elephant, fish, giraffe, horse, insect, jackelope" I want to loop through the list

Re: Hard to understand 'eval'

2008-06-15 Thread TheSaint
On 01:15, lunedì 16 giugno 2008 Calvin Spealman wrote: > such as getattr(obj, > methname)(a, b, c). Does this make sense? This is big enlightenment :) Thank you! :) I found problem with eval() when it comes to pass quoted strings. I circumvent that by encapsulating the strings in variable or tup

newbie: for loop within for loop question

2008-06-15 Thread takayuki
Hi everyone, I'm studying python via the excellent "how to think like a python programmer" book by Allen Downey. Noob question follows... I have a txt file (animals.txt) which contains the following text each on a separate line: aardvark, bat, cat, dog, elephant, fish, giraffe, horse, inchworm,

Re: The best way to package a Python module?

2008-06-15 Thread Jean-Paul Calderone
On Mon, 16 Jun 2008 08:39:52 +1000, Ben Finney <[EMAIL PROTECTED]> wrote: Jean-Paul Calderone <[EMAIL PROTECTED]> writes: On Mon, 16 Jun 2008 01:37:47 +0900, js <[EMAIL PROTECTED]> wrote: >By "package", I meant APT, Ports for BSD, MacPorts, etc. I don't know about ports or macport, but Debian

Re: Checking each item in m.group()?

2008-06-15 Thread Gilles Ganault
On Mon, 02 Jun 2008 17:49:11 -0700, Scott David Daniels <[EMAIL PROTECTED]> wrote: >(c, "NULL") is a tuple; it is being indexed by the boolean "c == ''" >Since False is 0, and True is 1, the expression picks out "NULL" >exactly when c is the zero-length string. Thanks Scott, and also to Peter abo

Re: please critique my thread code

2008-06-15 Thread MRAB
On Jun 15, 2:29 pm, [EMAIL PROTECTED] wrote: > I wrote a Python program (103 lines, below) to download developer data > from SourceForge for research about social networks. > > Please critique the code and let me know how to improve it. > > An example use of the program: > > prompt> python download

Re: The best way to package a Python module?

2008-06-15 Thread Ben Finney
Jean-Paul Calderone <[EMAIL PROTECTED]> writes: > On Mon, 16 Jun 2008 01:37:47 +0900, js <[EMAIL PROTECTED]> wrote: > >By "package", I meant APT, Ports for BSD, MacPorts, etc. > > I don't know about ports or macport, but Debian has recently > switched to a different policy for python packages whi

Re: marshal.dumps quadratic growth and marshal.dump not allowing file-like objects

2008-06-15 Thread John Machin
On Jun 16, 1:08 am, [EMAIL PROTECTED] wrote: > On Jun 15, 3:16 am, John Machin <[EMAIL PROTECTED]> wrote: > > > But that change went into the svn trunk on 11-May-2008; perhaps the OP > > is using a production release which would have the previous version, > > which is merely "newsize = size + 1024;

Re: Making wxPython a standard module?

2008-06-15 Thread Ben Finney
[EMAIL PROTECTED] writes: > On Jun 15, 9:37 am, Ben Finney <[EMAIL PROTECTED]> > wrote: > > The Zen of Python, by Tim Peters > > … > > There should be one-- and preferably only one --obvious way to do it. > > I agree with that concept. But there already is more than one way to > do it, only that

Re: Hard to understand 'eval'

2008-06-15 Thread John Machin
On Jun 16, 7:05 am, Dennis Lee Bieber <[EMAIL PROTECTED]> wrote: > On Sun, 15 Jun 2008 17:45:12 +0800, TheSaint <[EMAIL PROTECTED]> > declaimed the following in comp.lang.python: > > > is it an ifelifelif probing only the first matching case and drop > > the > > remaining checks? > >

Re: randrange loops

2008-06-15 Thread [EMAIL PROTECTED]
On 15 Jun, 21:05, "Terry Reedy" <[EMAIL PROTECTED]> wrote: > <[EMAIL PROTECTED]> wrote in message > > news:[EMAIL PROTECTED] > | Hi, > | > | > | I've created a method where the script defines twenty variables and > | several of them should be random having a maximum and a minimum value. > | > | Wha

Re: 32 bit or 64 bit?

2008-06-15 Thread [EMAIL PROTECTED]
On Jun 15, 11:30 pm, Christian Heimes <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] wrote: > > I have a physical system set up in which a body is supposed to > > accelerate and to get very close to lightspeed, while never really > > attaining it. After approx. 680 seconds, Python gets stuck and te

Re: Making wxPython a standard module?

2008-06-15 Thread Diez B. Roggisch
[EMAIL PROTECTED] schrieb: I know there must be at least a few very solid answers to this, but, just to hear it from the Pythonistas: Why can't there be several GUI toolkits on the standard library? Take my first post, add martin's maintenance + licensing-issues, and multiply the arguments by

Re: Creating a TCP/IP connection on already-networked computers

2008-06-15 Thread Grant Edwards
On 2008-06-15, John Salerno <[EMAIL PROTECTED]> wrote: > So in the case of me trying this with a friend who lives far > away, how would these two scripts work if we wouldn't be on > the same connection? It depends on the way the two networks are set up. Here's a fairly typical setup: Mac

Re: Automatically restarting system calls?

2008-06-15 Thread Rhamphoryncus
On Jun 15, 1:06 pm, Dan Stromberg <[EMAIL PROTECTED]> wrote: > On Sat, 14 Jun 2008 10:04:15 -0700, Rhamphoryncus wrote: > > On Jun 13, 10:41 am, Dan Stromberg <[EMAIL PROTECTED]> wrote: > >> I wrote a script(1) replacement in python > >> (http://stromberg.dnsalias.org/~dstromberg/pypty/), but I'm >

Re: Removing inheritance (decorator pattern ?)

2008-06-15 Thread Terry Reedy
"George Sakkis" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] |I have a situation where one class can be customized with several | orthogonal options. Currently this is implemented with (multiple) | inheritance but this leads to combinatorial explosion of subclasses as | more orthog

Re: 32 bit or 64 bit?

2008-06-15 Thread Christian Heimes
[EMAIL PROTECTED] wrote: > I have a physical system set up in which a body is supposed to > accelerate and to get very close to lightspeed, while never really > attaining it. After approx. 680 seconds, Python gets stuck and tells > me the object has passed lightspeed. I put the same equations in >

ANN: OpenOpt 0.18 (numerical optimization framework)

2008-06-15 Thread dmitrey
Greetings, We're pleased to announce: OpenOpt 0.18 (release), free (license: BSD) optimization framework (written in Python language) with connections to lots of solvers (some are C- or Fortran-written) is available for download. Changes since previous release 0.17 (March 15, 2008): * connec

Re: Removing inheritance (decorator pattern ?)

2008-06-15 Thread Diez B. Roggisch
George Sakkis schrieb: I have a situation where one class can be customized with several orthogonal options. Currently this is implemented with (multiple) inheritance but this leads to combinatorial explosion of subclasses as more orthogonal features are added. Naturally, the decorator pattern [1

Re: randrange loops

2008-06-15 Thread Terry Reedy
<[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] | Hi, | | | I've created a method where the script defines twenty variables and | several of them should be random having a maximum and a minimum value. | | What I did was this: | | from random import randrange as rr, random | | self.tr2

Re: Explaining Implementing a Binary Search Tree.

2008-06-15 Thread Terry Reedy
"Bart Kastermans" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] |I wrote a binary search tree in python, explaining as I was doing it | how and why I did it. I am very interested in receiving comments on | the code, process, and anything else that will improve my coding or | writin

Re: 32 bit or 64 bit?

2008-06-15 Thread [EMAIL PROTECTED]
On Jun 15, 9:41 pm, Mensanator <[EMAIL PROTECTED]> wrote: > On Jun 15, 12:10 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> > wrote: > > > > > On Jun 15, 7:43 pm, Peter Otten <[EMAIL PROTECTED]> wrote: > > > > [EMAIL PROTECTED] wrote: > > > > On Jun 15, 6:58 pm, Christian Meesters <[EMAIL PROTECTED]>

Re: 32 bit or 64 bit?

2008-06-15 Thread [EMAIL PROTECTED]
On Jun 15, 9:31 pm, casevh <[EMAIL PROTECTED]> wrote: > > Not yet: I was kind of set back when I saw their homepage was last > > updated 2002. But I'll give it a try. You think it's the best thing > > there is? > > > Thanks, > > Ram. > > gmpy has moved to Google. > > http://code.google.com/p/gmpy/

Re: 32 bit or 64 bit?

2008-06-15 Thread [EMAIL PROTECTED]
On Jun 15, 8:52 pm, Peter Otten <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] wrote: > > I have a physical system set up in which a body is supposed to > > accelerate and to get very close to lightspeed, while never really > > attaining it. After approx. 680 seconds, Python gets stuck and tells >

Re: 32 bit or 64 bit?

2008-06-15 Thread [EMAIL PROTECTED]
On Jun 15, 10:01 pm, "Terry Reedy" <[EMAIL PROTECTED]> wrote: > <[EMAIL PROTECTED]> wrote in message > > news:[EMAIL PROTECTED] > |> How did you determine that standard python floats are not good enough? > > | I have a physical system set up in which a body is supposed to > | accelerate and to get

Re: Automatically restarting system calls?

2008-06-15 Thread Dan Stromberg
On Sat, 14 Jun 2008 10:04:15 -0700, Rhamphoryncus wrote: > On Jun 13, 10:41 am, Dan Stromberg <[EMAIL PROTECTED]> wrote: >> I wrote a script(1) replacement in python >> (http://stromberg.dnsalias.org/ ~dstromberg/pypty/), but I'm >> encountering a problem in it. >> >> I think I know the solution t

Re: 32 bit or 64 bit?

2008-06-15 Thread Terry Reedy
<[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] |> How did you determine that standard python floats are not good enough? | I have a physical system set up in which a body is supposed to | accelerate and to get very close to lightspeed, while never really |attaining it. Just a thoug

Re: randrange loops

2008-06-15 Thread Peter Otten
[EMAIL PROTECTED] wrote: > I've created a method where the script defines twenty variables and > several of them should be random having a maximum and a minimum value. > > What I did was this: > > from random import randrange as rr, random > > self.tr2_vezes = self.rr(self.d_tr2_vezes[0],self.d

py2exe 0.6.8 released

2008-06-15 Thread Jimmy Retzlaff
py2exe 0.6.8 released = py2exe is a Python distutils extension which converts Python scripts into executable Windows programs, able to run without requiring a Python installation. Console and Windows (GUI) applications, Windows NT services, exe and dll COM servers are supported

Re: randrange loops

2008-06-15 Thread Cédric Lucantis
Le Sunday 15 June 2008 20:23:56 [EMAIL PROTECTED], vous avez écrit : > Hi, > > > I've created a method where the script defines twenty variables and > several of them should be random having a maximum and a minimum value. > > What I did was this: > > from random import randrange as rr, random > > s

Re: 32 bit or 64 bit?

2008-06-15 Thread Mensanator
On Jun 15, 12:10 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > On Jun 15, 7:43 pm, Peter Otten <[EMAIL PROTECTED]> wrote: > > > [EMAIL PROTECTED] wrote: > > > On Jun 15, 6:58 pm, Christian Meesters <[EMAIL PROTECTED]> wrote: > > >> > I do need speed. Is there an option? > > > >> Mind telling

Re: 32 bit or 64 bit?

2008-06-15 Thread casevh
> Not yet: I was kind of set back when I saw their homepage was last > updated 2002. But I'll give it a try. You think it's the best thing > there is? > > Thanks, > Ram. gmpy has moved to Google. http://code.google.com/p/gmpy/ gmpy only support the basic floating point operations so it may not b

Removing inheritance (decorator pattern ?)

2008-06-15 Thread George Sakkis
I have a situation where one class can be customized with several orthogonal options. Currently this is implemented with (multiple) inheritance but this leads to combinatorial explosion of subclasses as more orthogonal features are added. Naturally, the decorator pattern [1] comes to mind (not to b

randrange loops

2008-06-15 Thread [EMAIL PROTECTED]
Hi, I've created a method where the script defines twenty variables and several of them should be random having a maximum and a minimum value. What I did was this: from random import randrange as rr, random self.tr2_vezes = self.rr(self.d_tr2_vezes[0],self.d_tr2_vezes[-1], 1) # just an exa

Re: 32 bit or 64 bit?

2008-06-15 Thread Peter Otten
[EMAIL PROTECTED] wrote: > I have a physical system set up in which a body is supposed to > accelerate and to get very close to lightspeed, while never really > attaining it. After approx. 680 seconds, Python gets stuck and tells > me the object has passed lightspeed. I put the same equations in >

Re: Making wxPython a standard module?

2008-06-15 Thread Sebastian "lunar" Wiesner
"Martin v. Löwis" <[EMAIL PROTECTED]>: >> Just out of curiosity, what are the chances of this happening (sort of >> like what happened with sqlite)? > > As a starting point, the author(s) of wxPython would need to contribute > it to Python (and then also give the PSF the permission to relicense >

Re: Creating a TCP/IP connection on already-networked computers

2008-06-15 Thread Lie
On Jun 14, 11:31 pm, John Salerno <[EMAIL PROTECTED]> wrote: > Let me see if this question even makes sense...I'm reading Core Python > Programming and I jumped ahead to the more specific topics like network > programming. I plan to follow along with the example in that chapter and > create a socke

Re: Creating a TCP/IP connection on already-networked computers

2008-06-15 Thread Lie
On Jun 14, 11:31 pm, John Salerno <[EMAIL PROTECTED]> wrote: > Let me see if this question even makes sense...I'm reading Core Python > Programming and I jumped ahead to the more specific topics like network > programming. I plan to follow along with the example in that chapter and > create a socke

Re: Iterate creating variables?

2008-06-15 Thread Calvin Spealman
That smells bad the same was the eval() usage in the thread "Hard to understand 'eval'". This is only one pythoners opinion, of course. On Jun 13, 2008, at 3:29 PM, Jason Scheirer wrote: for x in xrange(1, 26): setattr(self, 'checkbox_%i' % x, ...) -- http://mail.python.org/mailman/listinfo/

Re: Hard to understand 'eval'

2008-06-15 Thread Calvin Spealman
The point here is that eval() use is general frowned upon. If you don't understand it or the alternatives, then you probably don't understand it well enough to make the call on using it or not. If you need just look up an attribute where the name of the attribute is in a variable, use getat

Re: 32 bit or 64 bit?

2008-06-15 Thread [EMAIL PROTECTED]
On Jun 15, 7:43 pm, Peter Otten <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] wrote: > > On Jun 15, 6:58 pm, Christian Meesters <[EMAIL PROTECTED]> wrote: > >> > I do need speed. Is there an option? > > >> Mind telling us what you *actually* want to achieve? (What do you want to > >> calculate?) >

Re: The best way to package a Python module?

2008-06-15 Thread Jean-Paul Calderone
On Mon, 16 Jun 2008 01:37:47 +0900, js <[EMAIL PROTECTED]> wrote: On Mon, Jun 16, 2008 at 1:16 AM, Jean-Paul Calderone <[EMAIL PROTECTED]> wrote: On Mon, 16 Jun 2008 01:01:47 +0900, js <[EMAIL PROTECTED]> wrote: Hi list, I'm trying to build a package for python modules. When I just wanted to

Re: 32 bit or 64 bit?

2008-06-15 Thread Christian Meesters
Peter Otten wrote: > > How did you determine that standard python floats are not good enough? > Everything beyond that is unlikely to be supported by the hardware and > will therefore introduce a speed penalty. > > Did you try gmpy? I would like to add: If Python's precision (or that of additiona

Re: problem with Py_BuildValue

2008-06-15 Thread Christian Meesters
Thank you so much - I was such an idiot (see below). >>> I see nothing wrong with your code so I'd say it is somewhere else (did >>> you snip any code between the end of the loop and the return?). > >>No. (Apart from freeing allocated memory.) > > I'm pretty sure we'll find something interesting

Re: Making wxPython a standard module?

2008-06-15 Thread Martin v. Löwis
> I know there must be at least a few very solid answers to this, but, > just to hear it from the Pythonistas: Why can't there be several GUI > toolkits on the standard library? Why do you think there can't be several GUI toolkits in the standard library? There is nothing that prohibits such a thi

Re: 32 bit or 64 bit?

2008-06-15 Thread Peter Otten
[EMAIL PROTECTED] wrote: > On Jun 15, 6:58 pm, Christian Meesters <[EMAIL PROTECTED]> wrote: >> > I do need speed. Is there an option? >> >> Mind telling us what you *actually* want to achieve? (What do you want to >> calculate?) >> >> Christian > > Physical simulations of objects with near-light

Re: The best way to package a Python module?

2008-06-15 Thread js
By "package", I meant APT, Ports for BSD, MacPorts, etc. On Mon, Jun 16, 2008 at 1:16 AM, Jean-Paul Calderone <[EMAIL PROTECTED]> wrote: > On Mon, 16 Jun 2008 01:01:47 +0900, js <[EMAIL PROTECTED]> wrote: >> >> Hi list, >> >> I'm trying to build a package for python modules. >> When I just wanted

Re: Making wxPython a standard module?

2008-06-15 Thread s0suk3
On Jun 15, 9:37 am, Ben Finney <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] writes: > > I know there must be at least a few very solid answers to this, but, > > just to hear it from the Pythonistas: Why can't there be several GUI > > toolkits on the standard library? > > Because the Zen of Python

Re: problem with Py_BuildValue

2008-06-15 Thread Cédric Lucantis
> Thank you. At least I can exclude another few error sources, now. > > >> I see nothing wrong with your code so I'd say it is somewhere else (did >> you snip any code between the end of the loop and the return?). >No. (Apart from freeing allocated memory.) I'm pretty sure we'll find something i

Re: The best way to package a Python module?

2008-06-15 Thread Jean-Paul Calderone
On Mon, 16 Jun 2008 01:01:47 +0900, js <[EMAIL PROTECTED]> wrote: Hi list, I'm trying to build a package for python modules. When I just wanted to have a package for Python2.5, this is an easy task, but in most cases, it's not enough. Sometimes I need python2.4, 2.5, 2.6 or 3.0 etc. The problem

Re: 32 bit or 64 bit?

2008-06-15 Thread [EMAIL PROTECTED]
On Jun 15, 6:58 pm, Christian Meesters <[EMAIL PROTECTED]> wrote: > > I do need speed. Is there an option? > > Mind telling us what you *actually* want to achieve? (What do you want to > calculate?) > > Christian Physical simulations of objects with near-lightspeed velocity. -- http://mail.python.

The best way to package a Python module?

2008-06-15 Thread js
Hi list, I'm trying to build a package for python modules. When I just wanted to have a package for Python2.5, this is an easy task, but in most cases, it's not enough. Sometimes I need python2.4, 2.5, 2.6 or 3.0 etc. The problem is coming from the fact that python installs its modules into versi

Re: 32 bit or 64 bit?

2008-06-15 Thread Christian Meesters
> I do need speed. Is there an option? Mind telling us what you *actually* want to achieve? (What do you want to calculate?) Christian -- http://mail.python.org/mailman/listinfo/python-list

Re: Making wxPython a standard module?

2008-06-15 Thread Torsten Bronger
Hallöchen! Grant Edwards writes: > On 2008-06-14, Torsten Bronger <[EMAIL PROTECTED]> wrote: > >>> You're saying that having the user or-together a bunch of >>> bitmasks and pass the result as an integer is a common way for >>> Python functions/object allow the user to turn optional features >>>

Re: problem with Py_BuildValue

2008-06-15 Thread Christian Meesters
Thank you. At least I can exclude another few error sources, now. Cédric Lucantis wrote: > I see nothing wrong with your code so I'd say it is somewhere else (did > you snip any code between the end of the loop and the return?). No. (Apart from freeing allocated memory.) > I've never > seen tho

Re: 32 bit or 64 bit?

2008-06-15 Thread [EMAIL PROTECTED]
On Jun 15, 5:05 pm, Christian Heimes <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] wrote: > > Does it mean that even now it does arithmetic in 64 bit? > > I'm not getting enough precision. Is there any way to increase it? > > Buy a good book about numerics or take a course. ;) > > Seriously, compu

Re: marshal.dumps quadratic growth and marshal.dump not allowing file-like objects

2008-06-15 Thread bkustel
On Jun 15, 3:16 am, John Machin <[EMAIL PROTECTED]> wrote: > But that change went into the svn trunk on 11-May-2008; perhaps the OP > is using a production release which would have the previous version, > which is merely "newsize = size + 1024;". > > Do people really generate 32MB pyc files, or is

Re: Making wxPython a standard module?

2008-06-15 Thread Ben Finney
[EMAIL PROTECTED] writes: > I know there must be at least a few very solid answers to this, but, > just to hear it from the Pythonistas: Why can't there be several GUI > toolkits on the standard library? Because the Zen of Python advises against it: >>> import this The Zen of Python, by Tim Pete

Re: Making wxPython a standard module?

2008-06-15 Thread s0suk3
I know there must be at least a few very solid answers to this, but, just to hear it from the Pythonistas: Why can't there be several GUI toolkits on the standard library? -- http://mail.python.org/mailman/listinfo/python-list

Re: Creating a TCP/IP connection on already-networked computers

2008-06-15 Thread Lie
On Jun 15, 8:40 am, John Salerno <[EMAIL PROTECTED]> wrote: > Grant Edwards wrote: > > If the two computers are in no way connected via any type of > > network, then the two programs won't be able to talk to each > > other. > > > The programs can't create a network, they can only use one that > > a

Re: please critique my thread code

2008-06-15 Thread Pau Freixes
Hi, The main while in main thread spend all cpu time, it's more convenient put one little sleep between each iteration or use a some synchronization method between threads. And about your questions IMO: > --- Are my setup and use of threads, the queue, and "while True" loop > correct or conven

Re: problem with Py_BuildValue

2008-06-15 Thread Cédric Lucantis
Hi, > Hi, > > currently I have a problem understanding Py_BuildValue. I have this code: > > static PyObject *function(PyObject *self, PyObject *args) { >PyObject * python_return_value = NULL; >PyObject * dummy = NULL; >double * internal_list; > > >/* converting to python repres

Re: 32 bit or 64 bit?

2008-06-15 Thread Christian Heimes
[EMAIL PROTECTED] wrote: > Does it mean that even now it does arithmetic in 64 bit? > I'm not getting enough precision. Is there any way to increase it? Buy a good book about numerics or take a course. ;) Seriously, computers and IEEE 754 floating point numbers have a lot of pit falls. If you cho

Explaining Implementing a Binary Search Tree.

2008-06-15 Thread Bart Kastermans
I wrote a binary search tree in python, explaining as I was doing it how and why I did it. I am very interested in receiving comments on the code, process, and anything else that will improve my coding or writing. I wrote this all up in my blog at: http://kasterma.wordpress.com/2008/06/15/implem

Re: Making wxPython a standard module?

2008-06-15 Thread Grant Edwards
On 2008-06-14, Torsten Bronger <[EMAIL PROTECTED]> wrote: >> You're saying that having the user or-together a bunch of >> bitmasks and pass the result as an integer is a common way for >> Python functions/object allow the user to turn optional >> features on and off? > > "Common" doesn't matter.

please critique my thread code

2008-06-15 Thread winston
I wrote a Python program (103 lines, below) to download developer data from SourceForge for research about social networks. Please critique the code and let me know how to improve it. An example use of the program: prompt> python download.py 1 24 The above command downloads data for the pro

Re: marshal.dumps quadratic growth and marshal.dump not allowing file-like objects

2008-06-15 Thread Christian Heimes
Raymond Hettinger wrote: > When more space is needed, the resize operation over-allocates by > double the previous need plus 1K. This should give amortized O(1) > performance just like list.append(). > > However, when that strategy requests more than 32Mb, the resizing > becomes less aggressive a

Re: Making wxPython a standard module?

2008-06-15 Thread Torsten Bronger
Hallöchen! Grant Edwards writes: > On 2008-06-14, Torsten Bronger <[EMAIL PROTECTED]> wrote: > >>> [...] >>> >>> IMO, a few of the "un-Pythonic" things about wxPython are: >>> >>> 1) Window ID numbers. >> >> When I started to use wxPython, there was a newly-introduced >> wx.ID_ANY that you could

Re: 32 bit or 64 bit?

2008-06-15 Thread Peter Otten
[EMAIL PROTECTED] wrote: > On Jun 15, 2:48 pm, Peter Otten <[EMAIL PROTECTED]> wrote: >> [EMAIL PROTECTED] wrote: >> > Quick question: >> > I have python code that does a lot of floating point arithmetic. How >> > do I make it do the arithmetic in 64 bit? (I have a 64 bit CPU.) If >> > I'll instal

Re: 32 bit or 64 bit?

2008-06-15 Thread Benjamin Kaplan
On Sun, Jun 15, 2008 at 8:02 AM, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > On Jun 15, 2:48 pm, Peter Otten <[EMAIL PROTECTED]> wrote: > > [EMAIL PROTECTED] wrote: > > > Quick question: > > > I have python code that does a lot of floating point arithmetic. How > > > do I make it do the arithme

Re: 32 bit or 64 bit?

2008-06-15 Thread [EMAIL PROTECTED]
On Jun 15, 2:48 pm, Peter Otten <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] wrote: > > Quick question: > > I have python code that does a lot of floating point arithmetic. How > > do I make it do the arithmetic in 64 bit? (I have a 64 bit CPU.) If > > I'll install a 64-bit operating system, will

problem with Py_BuildValue

2008-06-15 Thread Christian Meesters
Hi, currently I have a problem understanding Py_BuildValue. I have this code: static PyObject *function(PyObject *self, PyObject *args) { PyObject * python_return_value = NULL; PyObject * dummy = NULL; double * internal_list; /* converting to python representation */ for (i

Re: 32 bit or 64 bit?

2008-06-15 Thread Peter Otten
[EMAIL PROTECTED] wrote: > Quick question: > I have python code that does a lot of floating point arithmetic. How > do I make it do the arithmetic in 64 bit? (I have a 64 bit CPU.) If > I'll install a 64-bit operating system, will that do the trick? The Python float type uses a C double internall

Re: NoneType Error

2008-06-15 Thread Cédric Lucantis
Hi, Le Sunday 15 June 2008 10:35:18 Maryam Saeedi, vous avez écrit : > I am using a python program on a lot of different documents and for few of > them I will get NoneType error. I just want to skip those files and > continue for others, I do this without a problem for > IndexError,TypeError,Valu

Re: marshal.dumps quadratic growth and marshal.dump not allowing file-like objects

2008-06-15 Thread Peter Otten
John Machin wrote: >> Here's how marshal resizes the string: >> >> newsize = size + size + 1024; >> if (newsize > 32*1024*1024) { >> newsize = size + 1024*1024; >> } >> >> Maybe you can split your large objects and marshal multiple objects to >> keep the siz

  1   2   >