Re: XML validation in stdlib?

2008-06-15 Thread Stefan Behnel
Filip Gruszczyński wrote: > I took a look at the standard library and tried to find some > validation against schema tools, but found none. I googled, but found > only links to external libraries, that can do some validation. Does it > mean, that there is no validation in stdlib or have I just miss

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

2008-06-15 Thread bkustel
I'm stuck on a problem where I want to use marshal for serialization (yes, yes, I know (c)Pickle is normally recommended here). I favor marshal for speed for the types of data I use. However it seems that marshal.dumps() for large objects has a quadratic performance issue which I'm assuming is tha

Re: Avoiding redirects with urllib

2008-06-15 Thread Fernando Rodriguez
Hello [EMAIL PROTECTED], import urllib url_opener = urllib.URLopener() # create URLopener #You could also work with urllib.FancyURLopener try: data = url_opener.open("http://www.somedomain.com/index.html";) # open index.html except IOError, error_code: if error_code[0] == "http error": if erro

NoneType Error

2008-06-15 Thread Maryam Saeedi
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,ValueError,NameError : try: except (IndexError,TypeError,ValueError,NameErr

Re: Avoiding redirects with urllib

2008-06-15 Thread Fernando Rodriguez
Hello Fernando, I hope that's of some help! I think you may want to delve deeper into FancyURLopener... The problem is that I'm using a subclass of FancyOpener and it doesn't raise those exceptions. Ok, forget it, I should have read the "fine" manual. O:-) -- http://mail.python.org/mailma

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

2008-06-15 Thread TheSaint
On 16:04, domenica 15 giugno 2008 [EMAIL PROTECTED] wrote: > cStringIO.StringIO object to marshal.dump() instead but I quickly > learned this is not supported (only true file objects are supported). > > Any ideas about how to get around the marshal quadratic issue? Any > hope for a fix for that

Re: Hard to understand 'eval'

2008-06-15 Thread TheSaint
On 04:08, domenica 15 giugno 2008 [EMAIL PROTECTED] wrote: > what's wrong with getattr(cp, nn) ? The learning curve to get into these programming ways. Does gettattr run the snippet passed in? Considering that nn is a name of function, which will be called and (cfl, value) are the parameters to p

Re: Hard to understand 'eval'

2008-06-15 Thread TheSaint
On 06:34, domenica 15 giugno 2008 Dennis Lee Bieber wrote: >> for nn in stn_items: > I already see a syntax error when viewing that in Agent... A missing > indent level under the "for" The program don't complain wrong indentation, I mostly sure a wrong copy-paste error. Error doesn't com

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

2008-06-15 Thread Peter Otten
[EMAIL PROTECTED] wrote: > I'm stuck on a problem where I want to use marshal for serialization > (yes, yes, I know (c)Pickle is normally recommended here). I favor > marshal for speed for the types of data I use. > > However it seems that marshal.dumps() for large objects has a > quadratic perfo

Re: Configuration files

2008-06-15 Thread TheSaint
On 04:11, domenica 15 giugno 2008 Daniel Fetchinson wrote: > Check this out: http://www.voidspace.org.uk/python/configobj.html > Let me add: cfgparse, iniparse I've look at all to find a simple solution for my interest, but I realized not a good result. I'm using three of them ConfigParser, cfgpa

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

2008-06-15 Thread Raymond Hettinger
On Jun 15, 1:04 am, [EMAIL PROTECTED] wrote: > However it seems that marshal.dumps() for large objects has a > quadratic performance issue which I'm assuming is that it grows its > memory buffer in constant increments. Looking at the source in http://svn.python.org/projects/python/trunk/Python/ma

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

2008-06-15 Thread John Machin
On Jun 15, 7:47 pm, Peter Otten <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] wrote: > > I'm stuck on a problem where I want to use marshal for serialization > > (yes, yes, I know (c)Pickle is normally recommended here). I favor > > marshal for speed for the types of data I use. > > > However it s

bpython - fancy Python shell

2008-06-15 Thread Bob Farrell
I released this a while ago but did some work recently to fix some bugs so I thought I may as well post it here. To quickly summarise: In-line syntax highlighting Auto complete with suggestions as you type Pastebin stuff, save to file "Rewind" feature to jump back a line if you mess up (don't ask

Re: bpython - fancy Python shell

2008-06-15 Thread Andrii V. Mishkovskyi
2008/6/15, Bob Farrell <[EMAIL PROTECTED]>: > > I released this a while ago but did some work recently to fix some bugs > so I thought I may as well post it here. To quickly summarise: > In-line syntax highlighting > Auto complete with suggestions as you type > Pastebin stuff, save to file > "Rewin

32 bit or 64 bit?

2008-06-15 Thread [EMAIL PROTECTED]
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? -- http://mail.python.org/mailman/listinfo/python-list

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

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: 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

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 [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

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 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: 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: 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

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: 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.

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: 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

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: 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: 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: 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: 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: 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: 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: 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: 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: 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

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 [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.

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: 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: 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: 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: 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: 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: 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: 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: 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 [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: 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: 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: 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: 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: 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 >

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

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

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

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: 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

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 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

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: 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 [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: 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, 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, 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: 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: 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: 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

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: 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 >

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: 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: 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: 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: 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: 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: 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: 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: 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: 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: 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: 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: 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

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: 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 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: 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,

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: 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: 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: 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: 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

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: 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

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: 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

  1   2   >