ANN: eGenix mxODBC Connect Database Interface for Python 0.9.1 (beta)

2008-06-16 Thread eGenix Team: M.-A. Lemburg
ANNOUNCING eGenix.com mxODBC Connect Database Interface for Python Version 0.9.1 (beta) Our new client-server product for connecting Python applications

Decimals in python

2008-06-16 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-16 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:                 if

Re: os.walk Value Error?

2008-06-16 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 message when

Re: Decimals in python

2008-06-16 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

Re: NoneType Error

2008-06-16 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

Re: HTML FORM AND PYTHON

2008-06-16 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

All girls boys in dating available in this web sit join him

2008-06-16 Thread herlin
All girls boys in dating available in this web sit join him All girls boys in dating available in this web sit join him All girls boys in dating available in this web sit join him All girls boys in dating available in this web sit join him http://amigos.com/go/g979119-pct --

Re: Automatically restarting system calls?

2008-06-16 Thread Hrvoje Niksic
Rhamphoryncus [EMAIL PROTECTED] writes: You might find a way to get SA_RESTART applied, but it won't work right for you. Python splits signal handlers into a top half and a bottom half - the bottom is in C, it's the real signal handler, and top is in python. To keep things sane for the top

Changing Colors in gnuplot.py

2008-06-16 Thread arslanburney
Hello, Could some1 tell me how u could change the colours of the different lines that you have plotted while using gnuplot.py. Also how to change the background colour, line thickness etc. Thnx -- http://mail.python.org/mailman/listinfo/python-list

PEP 372 -- Adding an ordered directory to collections

2008-06-16 Thread Armin Ronacher
Abstract This PEP proposes an ordered dictionary as a new data structure for the ``collections`` module, called odict in this PEP for short. The proposed API incorporates the experiences gained from working with similar implementations that exist in various real-world applications and

Re: Combining music or video files?

2008-06-16 Thread Python.Arno
On 16 jun 2008, at 05:55, Jason Scheirer 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 an avi, put its contents into a

Re: PEP 372 -- Adding an ordered directory to collections

2008-06-16 Thread Michele Simionato
On Jun 16, 10:37 am, Armin Ronacher [EMAIL PROTECTED] wrote: Abstract This PEP proposes an ordered dictionary as a new data structure for the ``collections`` module, called odict in this PEP for short.  The proposed API incorporates the experiences gained from working with similar

Re: Removing inheritance (decorator pattern ?)

2008-06-16 Thread Diez B. Roggisch
Diez B. Roggisch wrote: 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.

Re: Best way to make a number of tests against an object('s attributes) with absence of switch statement?

2008-06-16 Thread Bruno Desthuilliers
Phillip B Oldham a écrit : What would be the optimal/pythonic way to subject an object to a number of tests (based on the object's attributes) and redirect program flow? Say I had the following: pets[0] = {'name': 'fluffy', 'species': 'cat', 'size': 'small'} pets[1] = {'name': 'bruno',

Re: Hard to understand 'eval'

2008-06-16 Thread Bruno Desthuilliers
TheSaint a écrit : 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? Nope, it just does what the name implies. Considering that nn is a name of

Re: Hard to understand 'eval'

2008-06-16 Thread Bruno Desthuilliers
TheSaint a écrit : 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

Re: PEP 372 -- Adding an ordered directory to collections

2008-06-16 Thread Ben Finney
Armin Ronacher [EMAIL PROTECTED] writes: This PEP proposes an ordered dictionary as a new data structure for the ``collections`` module, called odict in this PEP for short. A welcome addition. Since we're not proposing a built-in type, could we choose a name that is more explicit, and

Re: NoneType Error

2008-06-16 Thread Bruno Desthuilliers
Gabriel Genellina a écrit : En Sun, 15 Jun 2008 05:35:18 -0300, Maryam Saeedi [EMAIL PROTECTED] escribió: (snip) It appears that you want to catch all exceptions, just use Exception for that: try: ... except Exception: ... Hem... That's definitively *not* an a good advice here IMHO.

Re: PEP 372 -- Adding an ordered directory to collections

2008-06-16 Thread Wolfgang Grafen
Armin Ronacher schrieb: Other implementations of ordered dicts in various Python projects or standalone libraries, that inspired the API proposed here, are: - `odict in Babel`_ - `OrderedDict in Django`_ - `The odict module`_ - `ordereddict`_ (a C implementation of the odict module) -

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

2008-06-16 Thread Gilles Ganault
On Sun, 15 Jun 2008 18:15:38 -0700, Dennis Lee Bieber [EMAIL PROTECTED] wrote: I don't know quite what the reason for the sql = sql + ... is -- if you are trying to package more than one discrete statement into a single query you should be advised that not all adapters/DBMS support that

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

2008-06-16 Thread Raymond Hettinger
On Jun 15, 8:08 am, [EMAIL PROTECTED] wrote: Indeed. I (the OP) am using a production release which has the 1k linear growth. I am seeing the problems with ~5MB and ~10MB sizes. Apparently this will be improved greatly in Python 2.6, at least up to the 32MB limit. I've just fixed this for

ANN: eGenix mxODBC Connect Database Interface for Python 0.9.1 (beta)

2008-06-16 Thread eGenix Team: M.-A. Lemburg
ANNOUNCING eGenix.com mxODBC Connect Database Interface for Python Version 0.9.1 (beta) Our new client-server product for connecting Python applications

Re: PEP 372 -- Adding an ordered directory to collections

2008-06-16 Thread bearophileHUGS
Oh, very good, better late than never. This is my pure Python version, it performs get, set and del operations too in O(1): http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/498195 Working with C such data structure becomes much faster, because it can use true pointers. Then another data

String Concatenation O(n^2) (was: Re: Explaining Implementing a Binary Search Tree.)

2008-06-16 Thread Bart Kastermans
Summary: can't verify big O claim, how to properly time this? On Jun 15, 2:34 pm, Terry Reedy [EMAIL PROTECTED] wrote: 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

help in soaplib

2008-06-16 Thread sukadeb acharya
HI, I am trying to use the attachment object in soaplib. I am sending an attachment object and some other arguments and also receving an attachment object. So times I am able to receive the output image SVG file in my client side. But sometimes I am not. I am getting the following error message:

Context manager for files vs garbage collection

2008-06-16 Thread Floris Bruynooghe
Hi I was wondering when it was worthwil to use context managers for file. Consider this example: def foo(): t = False for line in file('/tmp/foo'): if line.startswith('bar'): t = True break return t What would the benefit of using a context manager

Python GC does not work as it should be

2008-06-16 Thread Jaimy Azle
See this piece of code: /* API to invoke gc.collect() from C */ Py_ssize_t PyGC_Collect(void) { Py_ssize_t n; if (collecting) n = 0; /* already collecting, don't do anything */ else { collecting = 1; n = collect(NUM_GENERATIONS - 1); collecting = 0; } return n; } If a system

Re: Python GC does not work as it should be

2008-06-16 Thread Jean-Paul Calderone
On Mon, 16 Jun 2008 17:51:00 +0700, Jaimy Azle [EMAIL PROTECTED] wrote: See this piece of code: /* API to invoke gc.collect() from C */ Py_ssize_t PyGC_Collect(void) { Py_ssize_t n; if (collecting) n = 0; /* already collecting, don't do anything */ else { collecting = 1; n =

Re: Python GC does not work as it should be

2008-06-16 Thread Jaimy Azle
Jean-Paul Calderone wrote: A system exception? What's that? C doesn't have exceptions. How could I determine it? I dont know GCC implementation, and others, but C on MSVC does have it. My application were not written in C, an exception raised was something like access violation at address

Showing a point in Gnuploy.py

2008-06-16 Thread arslanburney
Hello. Could some1 tell me how i could display a specific point in gnuplot.py. Supposingly if i have a point of intersection (2,3). How can i show this on the graph? As in how can i write near the point of intersection the value :(2,3). Thnx -- http://mail.python.org/mailman/listinfo/python-list

Re: Notify of change to list

2008-06-16 Thread Alan J. Salmoni
Paul - thank you very much for your help, it was much appreciated. I thought that this was the kind of thing I had to do. I also messed around with properties to try and solve this problem, but noticed a similar thing (ie, that changing a mutable attribute's element is different to rebinding it):

SPAM

2008-06-16 Thread Dantheman
SPAM -- http://mail.python.org/mailman/listinfo/python-list

Re: Python GC does not work as it should be

2008-06-16 Thread Jean-Paul Calderone
On Mon, 16 Jun 2008 18:11:24 +0700, Jaimy Azle [EMAIL PROTECTED] wrote: Jean-Paul Calderone wrote: A system exception? What's that? C doesn't have exceptions. How could I determine it? I dont know GCC implementation, and others, but C on MSVC does have it. My application were not written

sorted or .sort() ?

2008-06-16 Thread Peter Bengtsson
My poor understanding is that the difference between `sorted(somelist, key=lambda x:...)` and `somelist.sort(lambda x,y...)` is that one returns a new list and the other sorts in-place. Does that mean that .sort() is more efficient and should be favored when you can (i.e. when you don't mind

Re: PEP 372 -- Adding an ordered directory to collections

2008-06-16 Thread Jeroen Ruigrok van der Werven
-On [20080616 10:41], Armin Ronacher ([EMAIL PROTECTED]) wrote: This PEP proposes an ordered dictionary as a new data structure for the ``collections`` module, called odict in this PEP for short. I fully support adding this. In my work I have had to create this datatype a few times already

Re: sorted or .sort() ?

2008-06-16 Thread Ben Finney
Peter Bengtsson [EMAIL PROTECTED] writes: My poor understanding is that the difference between `sorted(somelist, key=lambda x:...)` and `somelist.sort(lambda x,y...)` is that one returns a new list and the other sorts in-place. Yes. Does that mean that .sort() is more efficient and should

Re: bpython - fancy Python shell

2008-06-16 Thread Wolfgang Grafen
I couldn't get it work on Solaris (modified some lines for Python2.3). One reason was that I had to download pyreadline separately - I did than but now pyreadline requires either ironpython or a windows installation. Something is going wrong... Best regards Wolfgang Bob Farrell schrieb: I

Zipping python modules

2008-06-16 Thread Brian Vanderburg II
I've installed Python 2.5 on MSW and it works. I'm preparing it to run from a thumb drive so I can run applications by dropping them onto the python.exe or from command line/etc. It works but the size is quite large. I've compressed most of the executables with UPX even the dlls under

Re: newbie question: for loop within for loop confusion

2008-06-16 Thread John Salerno
takayuki [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] John: There were two inchworms because c is in inchworm so it shouldn't print. Thanks for your detailed description of the for loop. lol, I even sat there looking at the word and said to myself ok, it doesn't contain any of

Re: newbie question: for loop within for loop confusion

2008-06-16 Thread John Salerno
takayuki [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] fin = open('animals.txt') for line in fin: You can write this as: for line in open('animals.txt'): #do stuff Of course, you can't explicitly close the file this way, but that probably doesn't matter. Another way, I

Re: PEP 372 -- Adding an ordered directory to collections

2008-06-16 Thread Calvin Spealman
This gets my +1, for what its worth. I don't really see a good reason not to include the insert() method, however. I don't see that it would complicate things much, if at all. d = odict([('a', 42), ('b', 23)]) d.insert(1, ('c', 19)) d collections.odict([('a', 42), ('c', 19), ('b', 23)])

Re: Context manager for files vs garbage collection

2008-06-16 Thread Bruno Desthuilliers
Floris Bruynooghe a écrit : Hi I was wondering when it was worthwil to use context managers for file. Consider this example: def foo(): t = False for line in file('/tmp/foo'): if line.startswith('bar'): t = True break return t What would the

Re: Combining music or video files?

2008-06-16 Thread John Salerno
Dennis Lee Bieber [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] On Sun, 15 Jun 2008 22:53:19 -0400, John Salerno [EMAIL PROTECTED] declaimed the following in comp.lang.python: Even the simplest format - WAV, which is normally uncompressed audio samples, is wrapped in layers of

Re: Iterate creating variables?

2008-06-16 Thread Hyuga
On Jun 13, 11:34 am, Reedick, Andrew [EMAIL PROTECTED] wrote: -Original Message- From: [EMAIL PROTECTED] [mailto:python- [EMAIL PROTECTED] On Behalf Of [EMAIL PROTECTED] Sent: Friday, June 13, 2008 11:11 AM To: [EMAIL PROTECTED] Subject: Iterate creating variables? I have

Re: Notify of change to list

2008-06-16 Thread Mike Kent
I recently wanted to do the same kind of thing. See this tread: http://groups.google.com/group/comp.lang.python/browse_thread/thread/f27c3b7950424e1c for details on how to do it. -- http://mail.python.org/mailman/listinfo/python-list

Re: Zipping python modules

2008-06-16 Thread Larry Bates
Brian Vanderburg II wrote: I've installed Python 2.5 on MSW and it works. I'm preparing it to run from a thumb drive so I can run applications by dropping them onto the python.exe or from command line/etc. It works but the size is quite large. I've compressed most of the executables with

Re: PEP 372 -- Adding an ordered directory to collections

2008-06-16 Thread Paul McGuire
1. With the current dict, the following code a = { A : 1, B : 2 } b = { B : 2, A : 1 } a==b evaluates to True. I assume that if these were odicts, this would evaluate to False. 2. Will odict.byindex support slicing? 3. Will odict inherit from dict? 4. The current dict API (as of Python 2.5)

Who is using python-ldap with Python 1.5.x and 2.0-2.2?

2008-06-16 Thread Michael Ströder
HI! I'd like to hear from the Python community whether support for Python version prior to 2.3 is still needed in python-ldap. Please tell me which Python version you're using and why it'd be important for you to have python-ldap updates still supporting it. BTW: Actually older Python

haif riends how do you

2008-06-16 Thread google
hi friends COMMON DO YOU SEE THE DIFFERNT PICTURE AND INFORMATION COMMON LETS GOO http://www.airnet5.blogspot.com http://www.airnet5.blogspot.com http://www.airnet5.blogspot.com http://www.airnet5.blogspot.com http://www.airnet5.blogspot.com http://www.airnet5.blogspot.com

Re: Who is using python-ldap with Python 1.5.x and 2.0-2.2?

2008-06-16 Thread Jeroen Ruigrok van der Werven
-On [20080616 15:55], Michael Ströder ([EMAIL PROTECTED]) wrote: I'd like to hear from the Python community whether support for Python version prior to 2.3 is still needed in python-ldap. Please tell me which Python version you're using and why it'd be important for you to have python-ldap

Re: sorted or .sort() ?

2008-06-16 Thread Hrvoje Niksic
Peter Bengtsson [EMAIL PROTECTED] writes: Does that mean that .sort() is more efficient and should be favored when you can (i.e. when you don't mind changing the listish object)? Yes. Note that it's not the listish object, the sort method is implemented on actual lists, not on any sequence.

RE: PEP 372 -- Adding an ordered directory to collections

2008-06-16 Thread Paul McGuire
:) Yes, I thought about that even as I was writing that post. But I also said, ParseResults implements quite a bit of additional behavior that would not be required or necessarily appropriate for odict. Even if odict existed, I think I would have needed ParseResults anyway (but using an odict

Re: Removing inheritance (decorator pattern ?)

2008-06-16 Thread George Sakkis
On Jun 16, 5:04 am, Diez B. Roggisch [EMAIL PROTECTED] wrote: Diez B. Roggisch wrote: 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

sexe day

2008-06-16 Thread suresh
u want the all sexye flimes ues this u want me see this *** *** http;//lesbiangroupsexy.blogspot.com/ --

### hai, make money very simple on internet. earn at home very easily .........###

2008-06-16 Thread jeeno
Hello friends guys, I want to tell you about great site I found. They pay me to read e- mail, visit sign in the web sites and much more. earn easily without investment. It's free to join and easy to sign up! CLICK THIS LINK TO VISIT: http://www.ippomails.net/pages/index.php?refid=veeramani

Re: Removing inheritance (decorator pattern ?)

2008-06-16 Thread Diez B. Roggisch
Ok, I see how this would work (and it's trivial to make it cache the generated classes for future use) but I guess I was looking for a more mainstream approach, something that even a primitive statically typed language could run :) Even in Python though, I think of Runtime Type Generation

'string'.strip(chars)-like function that removes from the middle?

2008-06-16 Thread Ethan Furman
Greetings. The strip() method of strings works from both ends towards the middle. Is there a simple, built-in way to remove several characters from a string no matter their location? (besides .replace() ;) For example: .strip -- 'www.example.com'.strip('cmowz.') 'example' .??? -- ---

Re: py2exe 0.6.8 released

2008-06-16 Thread Larry Bates
Jimmy Retzlaff wrote: 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

Re: 'string'.strip(chars)-like function that removes from the middle?

2008-06-16 Thread Calvin Spealman
On Jun 16, 2008, at 12:58 PM, Ethan Furman wrote: Greetings. The strip() method of strings works from both ends towards the middle. Is there a simple, built-in way to remove several characters from a string no matter their location? (besides .replace() ;) For example: .strip --

Re: 'string'.strip(chars)-like function that removes from the middle?

2008-06-16 Thread Cédric Lucantis
Hi, Greetings. The strip() method of strings works from both ends towards the middle. Is there a simple, built-in way to remove several characters from a string no matter their location? (besides .replace() ;) For example: .strip -- 'www.example.com'.strip('cmowz.') 'example' .??? --

Re: 'string'.strip(chars)-like function that removes from the middle?

2008-06-16 Thread Larry Bates
Ethan Furman wrote: Greetings. The strip() method of strings works from both ends towards the middle. Is there a simple, built-in way to remove several characters from a string no matter their location? (besides .replace() ;) For example: .strip -- 'www.example.com'.strip('cmowz.') 'example'

Re: String Concatenation O(n^2) (was: Re: Explaining Implementing a Binary Search Tree.)

2008-06-16 Thread Ian Kelly
On Mon, Jun 16, 2008 at 4:34 AM, Bart Kastermans [EMAIL PROTECTED] wrote: This is interesting. I had never attempted to verify a big O statement before, and decided that it would be worth trying. So I wrote some code to collect data, and I can't find that it goes quadratic. I have the

Re: PEP 372 -- Adding an ordered directory to collections

2008-06-16 Thread ivarnelispam
I'm very happy to see this PEP. I have needed to use ordered dictionaries many times, and this has always felt to me like a surprising omission from Python. -- http://mail.python.org/mailman/listinfo/python-list

Re: 'string'.strip(chars)-like function that removes from the middle?

2008-06-16 Thread Maric Michaud
Le Monday 16 June 2008 18:58:06 Ethan Furman, vous avez écrit : The strip() method of strings works from both ends towards the middle. Is there a simple, built-in way to remove several characters from a string no matter their location? (besides .replace() ;) For example: .strip --

Re: String Concatenation O(n^2) (was: Re: Explaining Implementing a Binary Search Tree.)

2008-06-16 Thread Jean-Paul Calderone
On Mon, 16 Jun 2008 10:41:05 -0600, Ian Kelly [EMAIL PROTECTED] wrote: On Mon, Jun 16, 2008 at 4:34 AM, Bart Kastermans [EMAIL PROTECTED] wrote: This is interesting. I had never attempted to verify a big O statement before, and decided that it would be worth trying. So I wrote some code to

Python-URL! - weekly Python news and links (Jun 16)

2008-06-16 Thread Gabriel Genellina
QOTW: The problem [with C++] is, I never feel like I'm programing the *problem*, I always feel like I'm programming the *language*. - Roy Smith Alternatives to the Decimal type: http://groups.google.com/group/comp.lang.python/browse_thread/thread/9cd6dae725268afb/ How

Re: 'string'.strip(chars)-like function that removes from the middle?

2008-06-16 Thread Peter Otten
Ethan Furman wrote: The strip() method of strings works from both ends towards the middle. Is there a simple, built-in way to remove several characters from a string no matter their location? (besides .replace() ;) identity = .join(map(chr, range(256))) 'www.example.com'.translate(identity,

Re: 'string'.strip(chars)-like function that removes from the middle?

2008-06-16 Thread Raymond Hettinger
On Jun 16, 10:09 am, Peter Otten [EMAIL PROTECTED] wrote: Ethan Furman wrote: The strip() method of strings works from both ends towards the middle. Is there a simple, built-in way to remove several characters from a string no matter their location? (besides .replace() ;) identity =

Re: String Concatenation O(n^2) (was: Re: Explaining Implementing a Binary Search Tree.)

2008-06-16 Thread Ian Kelly
On Mon, Jun 16, 2008 at 11:09 AM, Jean-Paul Calderone [EMAIL PROTECTED] wrote: It will depend what version of Python you're using and the *exact* details of the code in question. An optimization was introduced where, if the string being concatenated to is not referred to anywhere else, it will

Re: sorted or .sort() ?

2008-06-16 Thread Raymond Hettinger
On Jun 16, 5:11 am, Peter Bengtsson [EMAIL PROTECTED] wrote: My poor understanding is that the difference between `sorted(somelist, key=lambda x:...)` and `somelist.sort(lambda x,y...)` is that one returns a new list and the other sorts in-place. Does that mean that .sort() is more efficient

Re: Removing inheritance (decorator pattern ?)

2008-06-16 Thread Gerard flanagan
George Sakkis wrote: 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: bpython - fancy Python shell

2008-06-16 Thread Sebastian lunar Wiesner
Wolfgang Grafen [EMAIL PROTECTED]: I couldn't get it work on Solaris (modified some lines for Python2.3). If solaris doesn't have a readline library, you might try to compile gnu readline, and recompile python (also a chance to get the current version 2.5) One reason was that I had to

sqlite3 and Python 2.5.1

2008-06-16 Thread milan_sanremo
I have sqlite installed, but when I try to import sqlite3 I receive: Python 2.5.1 (r251:54863, Nov 3 2007, 02:54:36) [C] on sunos5 Type help, copyright, credits or license for more information. import sqlite3 Traceback (most recent call last): File stdin, line 1, in module ImportError: No

Re: String Concatenation O(n^2) (was: Re: Explaining Implementing a Binary Search Tree.)

2008-06-16 Thread Alex Elder
I found this article useful when dealing with strings in Python: http://www.skymind.com/~ocrow/python_string/ It may help squeeze some more time out of your code. 8-) Alex. -- http://mail.python.org/mailman/listinfo/python-list

Re: numpy: handling float('NaN') different in XP vs. Linux

2008-06-16 Thread John [H2O]
Dan Bishop wrote: Python just uses the atof() function from the underlying C library. Some of them handle NaN's, and some of them don't. As a work around, how would I write this in list comprehension form: newlist=[] for i in range(len(v[1])): try:

Re: sqlite3 and Python 2.5.1

2008-06-16 Thread Lie
On Jun 17, 12:59 am, milan_sanremo [EMAIL PROTECTED] wrote: I have sqlite installed, but when I try to import sqlite3 I receive: Python 2.5.1 (r251:54863, Nov  3 2007, 02:54:36) [C] on sunos5 Type help, copyright, credits or license for more information. import sqlite3 Traceback (most

Re: Removing inheritance (decorator pattern ?)

2008-06-16 Thread George Sakkis
On Jun 16, 1:49 pm, Gerard flanagan [EMAIL PROTECTED] wrote: George Sakkis wrote: 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

Re: PEP 372 -- Adding an ordered directory to collections

2008-06-16 Thread [EMAIL PROTECTED]
On 16 juin, 10:37, Armin Ronacher [EMAIL PROTECTED] wrote: Abstract This PEP proposes an ordered dictionary as a new data structure for the ``collections`` module, called odict in this PEP for short. The proposed API incorporates the experiences gained from working with similar

Re: Configuration files

2008-06-16 Thread Robert
Does ConfigParser allow writing configuration changes also? Dennis Lee Bieber [EMAIL PROTECTED] schreef in bericht news:[EMAIL PROTECTED] On Sat, 14 Jun 2008 21:27:19 +0200, Robert [EMAIL PROTECTED] declaimed the following in comp.lang.python: What is the most Pythonic way to maintain a

Re: String Concatenation O(n^2) (was: Re: Explaining Implementing a Binary Search Tree.)

2008-06-16 Thread Jean-Paul Calderone
On Mon, 16 Jun 2008 11:30:19 -0600, Ian Kelly [EMAIL PROTECTED] wrote: On Mon, Jun 16, 2008 at 11:09 AM, Jean-Paul Calderone [EMAIL PROTECTED] wrote: It will depend what version of Python you're using and the *exact* details of the code in question. An optimization was introduced where, if the

President Bush Meets Pope Before Heading to Paris

2008-06-16 Thread vaticans.org
U.S. President George Bush has met with Pope Benedict at the Vatican, as he continues his week-long European trip. After his talks with the pontiff, Mr. Bush was traveling to Paris, France, where he is to give a speech later Friday on the strong relationship between the U.S. and Europe. U.S.

Re: py2exe 0.6.8 released

2008-06-16 Thread Robert
Being new on on Python (but otherwise experienced programmer this message triggered me to do the install. It looks like a nice way to do a comprehensive check of your system. When running one of the py2exe samples, located in C:\Python25\Lib\site-packages\py2exe\samples\singlefile\gui I got the

Re: String Concatenation O(n^2) (was: Re: Explaining Implementing a Binary Search Tree.)

2008-06-16 Thread Ian Kelly
On Mon, Jun 16, 2008 at 12:07 PM, Alex Elder [EMAIL PROTECTED] wrote: I found this article useful when dealing with strings in Python: http://www.skymind.com/~ocrow/python_string/ It may help squeeze some more time out of your code. 8-) Things seem to have changed since then. I'm

How to request data from a lazily-created tree structure ?

2008-06-16 Thread méchoui
Problem: - You have tree structure (XML-like) that you don't want to create 100% in memory, because it just takes too long (for instance, you need a http request to request the information from a slow distant site). - But you want to be able to request data from it, such has give me all nodes

vmware job vacancy!

2008-06-16 Thread Mr Shore
A veteran engineer from VMWare Inc., Jeffrey, is being featured on jobirn.com on Monday Jun 16, from 9am to 5pm (PST.) He will chat with applicants who are interested in job openings in VMWare. He will identify qualified candidates and directly submit qualified candidates' resumes to hiring

Good cross-host IPC?

2008-06-16 Thread Kirk Strauser
We've been using NetWorkSpaces (http://www.ddj.com/web-development/21971) for IPC on programs running on several different machines. Since it uses a central, shared server for storing values, you don't have to write socket code in your various programs to pass data back and forth. For

Re: numpy: handling float('NaN') different in XP vs. Linux

2008-06-16 Thread Robert Kern
John [H2O] wrote: Dan Bishop wrote: Python just uses the atof() function from the underlying C library. Some of them handle NaN's, and some of them don't. As a work around, how would I write this in list comprehension form: newlist=[] for i in range(len(v[1])):

Re: newbie question: for loop within for loop confusion

2008-06-16 Thread MRAB
On Jun 16, 7:17 am, Paul Hankin [EMAIL PROTECTED] wrote: 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

Re: Simple and safe evaluator

2008-06-16 Thread bvdp
Okay guys. I have the _ast based safe eval installed and working in my program. It appears to be working just fine. Thanks for the help. Now, a few more questions: 1. I see that _ast is a 2.5 module?? So, for folks using my code with 2.5 I could do something like this: # I've got some

Re: 32 bit or 64 bit?

2008-06-16 Thread [EMAIL PROTECTED]
On Jun 16, 12:57 am, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: 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

Re: sqlite3 and Python 2.5.1

2008-06-16 Thread Gerhard Häring
milan_sanremo wrote: I have sqlite installed, but when I try to import sqlite3 I receive: Python 2.5.1 (r251:54863, Nov 3 2007, 02:54:36) [C] on sunos5 Type help, copyright, credits or license for more information. import sqlite3 Traceback (most recent call last): File stdin, line 1, in

Re: How to request data from a lazily-created tree structure ?

2008-06-16 Thread Diez B. Roggisch
méchoui schrieb: Problem: - You have tree structure (XML-like) that you don't want to create 100% in memory, because it just takes too long (for instance, you need a http request to request the information from a slow distant site). - But you want to be able to request data from it, such has

Re: Simple and safe evaluator

2008-06-16 Thread George Sakkis
On Jun 16, 4:47 pm, bvdp [EMAIL PROTECTED] wrote: 2. I thought I'd be happy with * / + -, etc. Of course now I want to add a few more funcs like int() and sin(). How would I do that? For the builtin eval, just populate the globals dict with the names you want to make available: import math

Re: sorted or .sort() ?

2008-06-16 Thread Nick Craig-Wood
Ben Finney [EMAIL PROTECTED] wrote: Peter Bengtsson [EMAIL PROTECTED] writes: My poor understanding is that the difference between `sorted(somelist, key=lambda x:...)` and `somelist.sort(lambda x,y...)` is that one returns a new list and the other sorts in-place. Yes. Does that

Re: newbie question: for loop within for loop confusion

2008-06-16 Thread Thomas Hill
On Jun 15, 6:23 pm, takayuki [EMAIL PROTECTED] wrote: def hasnolet(avoid): fin = open('animals.txt') for line in fin: word = line.strip() for letter in avoid: if letter in word: break

Re: newbie question: for loop within for loop confusion

2008-06-16 Thread Thomas Hill
On Jun 16, 2:34 pm, Thomas Hill [EMAIL PROTECTED] wrote: On Jun 15, 6:23 pm, takayuki [EMAIL PROTECTED] wrote: def hasnolet(avoid): fin = open('animals.txt') for line in fin: word = line.strip() for letter in avoid:

Re: How to request data from a lazily-created tree structure ?

2008-06-16 Thread méchoui
On Jun 16, 11:16 pm, Diez B. Roggisch [EMAIL PROTECTED] wrote: méchoui schrieb: Problem: - You have tree structure (XML-like) that you don't want to create 100% in memory, because it just takes too long (for instance, you need a http request to request the information from a slow

Please explain Python __whatever__ construct.

2008-06-16 Thread bsagert
After a couple of weeks studying Python, I already have a few useful scripts, including one that downloads 1500 Yahoo stock quotes in 6 seconds. However, many things are puzzling to me. I keep on seeing things like __main__ in scripts. A more obscure example would be __add__ used in string

Re: Simple and safe evaluator

2008-06-16 Thread bvdp
George Sakkis wrote: On Jun 16, 4:47 pm, bvdp [EMAIL PROTECTED] wrote: 2. I thought I'd be happy with * / + -, etc. Of course now I want to add a few more funcs like int() and sin(). How would I do that? For the builtin eval, just populate the globals dict with the names you want to make

  1   2   >