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 -- http://mail.

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

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

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', 'species

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 func

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 strings

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 co

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) - `StableDic

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 fo

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 str

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 d

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 be

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 excepti

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 = collect(NUM_GE

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 addr

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 writte

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 chang

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 f

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 sho

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 re

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

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 co

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

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

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 benefit

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 lay

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 variable

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 UPX

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 Pyth

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 versio

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 http://www.airnet5.b

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 y

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 sequ

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 co

sexe day

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

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

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 Generati

'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' .??? --> --- 'www.ex

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 C

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 --> 'www.exampl

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 th

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

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

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() ;) > >>> iden

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

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 effi

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 down

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 "", line 1, in ImportError: No mo

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])): t

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

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

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 >

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 ma

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

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

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

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 tha

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 manager

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 example

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

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 imp

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

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

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

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

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

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

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 con

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 av

Re: Please explain Python "__whatever__" construct.

2008-06-16 Thread Jason Scheirer
On Jun 16, 2:56 pm, [EMAIL PROTECTED] wrote: > 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

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

2008-06-16 Thread Martin v. Löwis
> ``odict.byindex(index)`` > > Index-based lookup is supported by ``byindex()`` which returns > the key/value pair for an index, that is, the "position" of a > key in the ordered dict. 0 is the first key/value pair, -1 > the last. > > >>> d.byindex(2)

Re: Please explain Python "__whatever__" construct.

2008-06-16 Thread Benjamin Kaplan
On Mon, Jun 16, 2008 at 5:56 PM, <[EMAIL PROTECTED]> wrote: > 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 s

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

2008-06-16 Thread bearophileHUGS
Martin v. L.: > For this API, I think it's important to make some performance guarantees. I may appreciate them for all Python collections :-) > It seems fairly difficult to make byindex O(1), and > simultaneously also make insertion/deletion better than O(n). It may be possible to make both of

Re: Please explain Python "__whatever__" construct.

2008-06-16 Thread s0suk3
On Jun 16, 4:56 pm, [EMAIL PROTECTED] wrote: > 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

Re: sqlite3 and Python 2.5.1

2008-06-16 Thread Robert Hancock
On Jun 16, 5:15 pm, Gerhard Häring <[EMAIL PROTECTED]> wrote: > milan_sanremo wrote: > > I have sqlite installed, but when I try to importsqlite3I 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.

Re: Please explain Python "__whatever__" construct.

2008-06-16 Thread Matimus
When and why would I ever use > "__main__" or the many other "__whatever__" constructs? You don't generally use those names directly, they are 'magic'. The __add__ example is a good one. When you do `"hello " + "world"` behind the scenes python is actually calling "hello ".__add__("world"). There

  1   2   >