Re: TypeError: can't pickle HASH objects?

2008-10-01 Thread electronixtar
James Mills wrote: > On Thu, Oct 2, 2008 at 3:34 PM, est <[EMAIL PROTECTED]> wrote: > >> wow. It's giga-size file. I need stream reading it, md5 it. It may >> break for a while. >> > > So use generators and consume the stream ? > > --JamesMills > > it's not the stream's problem. it the m

Re: Odd Errors

2008-10-01 Thread Lawrence D'Oliveiro
In message <[EMAIL PROTECTED]>, Steven D'Aprano wrote: > On Wed, 01 Oct 2008 22:14:49 +1300, Lawrence D'Oliveiro wrote: > >> In message >> <[EMAIL PROTECTED]>, >> Aaron "Castironpi" Brady wrote: >> >>> Do you ever want to scream from the rooftops, "'append' operates by >>> side-effect!"? >> >>

Re: TypeError: can't pickle HASH objects?

2008-10-01 Thread James Mills
On Thu, Oct 2, 2008 at 3:34 PM, est <[EMAIL PROTECTED]> wrote: > wow. It's giga-size file. I need stream reading it, md5 it. It may > break for a while. So use generators and consume the stream ? --JamesMills -- -- -- "Problems are solved by method" -- http://mail.python.org/mailman/listinfo/py

Re: index all instances by id - a memory leak?

2008-10-01 Thread Marc 'BlackJack' Rintsch
On Wed, 01 Oct 2008 21:54:26 -0700, Dan Barbus wrote: > def __del__(self): > Item._count -= 1 > # Should I do something here to delete the instance? > # Will this ever be called if the instance is in a static > dictionary? Don't use the `__del__()` method. It is not r

Re: what does "python -i" use as input stream (stdin)?

2008-10-01 Thread Gabriel Genellina
En Wed, 01 Oct 2008 14:48:52 -0300, Almar Klein <[EMAIL PROTECTED]> escribió: I wanted to give your solution a try, but got stuck. The file that I want to replace the "standard input" with is a pseudo file object with a custom read method. I have a hard time finding out how to have a file d

Re: index all instances by id - a memory leak?

2008-10-01 Thread Jason Scheirer
On Oct 1, 10:01 pm, Dan Barbus <[EMAIL PROTECTED]> wrote: > On Oct 2, 7:54 am, Dan Barbus <[EMAIL PROTECTED]> wrote: > > > > >     def getItemById(id): > >         return _itemsById[id] > > I just saw that this won't compile. Still, ignoring this, I thing the > purpose of the code is pretty clear.

Re: TypeError: can't pickle HASH objects?

2008-10-01 Thread est
On Oct 2, 11:27 am, "Aaron \"Castironpi\" Brady" <[EMAIL PROTECTED]> wrote: > On Oct 1, 2:50 pm, est <[EMAIL PROTECTED]> wrote: > > > > > > > >>> import md5 > > >>> a=md5.md5() > > >>> import pickle > > >>> pickle.dumps(a) > > > Traceback (most recent call last): > >   File "", line 1, in > >   Fi

Re: RELEASED Python 2.6 final

2008-10-01 Thread Paul Rubin
Barry Warsaw <[EMAIL PROTECTED]> writes: > http://docs.python.org/dev/whatsnew/2.6.html Wow! This is a very major upgrade with lots of welcome extensions. I hadn't been following the 2.6 efforts that closely so I am awed. Congrats! -- http://mail.python.org/mailman/listinfo/python-list

Re: Isolated environment for execfile

2008-10-01 Thread Gabriel Genellina
En Wed, 01 Oct 2008 08:11:29 -0300, Igor Kaplan <[EMAIL PROTECTED]> escribió: I got quite unusual problem and all my searches to find the answer on my own were not successful. Here is the scenario: I have the python program, let's call it script1.py, this program needs to execute an

Re: RELEASED Python 2.6 final

2008-10-01 Thread Chris Rebert
Also, the docs currently seem broken. Example: http://docs.python.org/library/weakref.html#module-weakref , which is linked to from the new module index page, gives a 404 error. Cheers, Chris Rebert On Wed, Oct 1, 2008 at 8:46 PM, Barry Warsaw <[EMAIL PROTECTED]> wrote: > -BEGIN PGP SIGNED ME

Re: index all instances by id - a memory leak?

2008-10-01 Thread Dan Barbus
On Oct 2, 7:54 am, Dan Barbus <[EMAIL PROTECTED]> wrote: > >     def getItemById(id): >         return _itemsById[id] I just saw that this won't compile. Still, ignoring this, I thing the purpose of the code is pretty clear. Thanks for any feedback. -- http://mail.python.org/mailman/listinfo/pyt

index all instances by id - a memory leak?

2008-10-01 Thread Dan Barbus
Hi all, I'm a python beginner, and I have a problem with no solution I can see: I want to index all instances of an object by an internal id (not the hash) and be able to retrieve them later. I created a class-level dictionary (Item._itemById) where I add every new instance. My problem is: How

Re: RELEASED Python 2.6 final

2008-10-01 Thread Michele Simionato
On Oct 2, 5:46 am, Barry Warsaw <[EMAIL PROTECTED]> wrote: > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA1 > > On behalf of the Python development team and the Python community, I   > am happy to announce the release of Python 2.6 final. Cool! I have just downloaded the Mac installer and did the

RELEASED Python 2.6 final

2008-10-01 Thread Barry Warsaw
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On behalf of the Python development team and the Python community, I am happy to announce the release of Python 2.6 final. This is the production-ready version of the latest in the Python 2 series. There are many new features and modules, impro

Re: TypeError: can't pickle HASH objects?

2008-10-01 Thread Aaron "Castironpi" Brady
On Oct 1, 2:50 pm, est <[EMAIL PROTECTED]> wrote: > >>> import md5 > >>> a=md5.md5() > >>> import pickle > >>> pickle.dumps(a) > > Traceback (most recent call last): >   File "", line 1, in >   File "C:\Python25\lib\pickle.py", line 1366, in dumps >     Pickler(file, protocol).dump(obj) >   File "

Re: Peek inside iterator (is there a PEP about this?)

2008-10-01 Thread Aaron "Castironpi" Brady
On Oct 1, 3:14 pm, Terry Reedy <[EMAIL PROTECTED]> wrote: > Luis Zarrabeitia wrote: > > Hi there. > > > For most use cases I think about, the iterator protocol is more than enough. > > However, on a few cases, I've needed some ugly hacks. > > > Ex 1: > > > a = iter([1,2,3,4,5]) # assume you got the

Re: Socket Question

2008-10-01 Thread Mark Tolonen
"Ali Hamad" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] Hello All : A socket question from a networking newbie. I need to create a server that: 1) receive a message from client. 2) check that message and response to it. 3) the client get the server message and send another me

Re: How to emit UTF-8 from console mode?

2008-10-01 Thread Mark Tolonen
"Siegfried Heintze" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] Make sure you are using the Lucida Console font for the cmd.exe window and type the commands: chcp 1251 python -c "print ''.join(unichr(i) for i in range(0x410,0x431))" Output: ?

Re: docstrings => RestructuredText => Sphinx => Nice html docs (?)

2008-10-01 Thread Benjamin
On Oct 1, 4:10 pm, Infinity77 <[EMAIL PROTECTED]> wrote: > Hi All, > >     I apologize in advance if my question sounds dumb. I googled back > and forth but my google-fu today is not working very well... > I have seen the new style Python html documentation, which is > extremely nice, and by readin

Re: How to emit UTF-8 from console mode?

2008-10-01 Thread Mark Tolonen
"Ross Ridge" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] I need UTF-8 because I need to experiment with some OS function calls that give me UTF-16 and I need to emit UTF-16 or UTF-8. <[EMAIL PROTECTED]> wrote: Try setting the code page to 65001, and emit the UTF-8 explicitly

Re: Python arrays and sting formatting options

2008-10-01 Thread Paul Probert
Grant Edwards wrote: > On 2008-09-30, Peter Pearson <[EMAIL PROTECTED]> wrote: >> On Tue, 30 Sep 2008 00:04:18 +0200, Ivan Rebori wrote: >>> 1. Multi dimensional arrays - how do you load them in python >>> For example, if I had: >>> --- >>> 1 2 3 >>> 4 5 6 >>> 7 8 9 >>> >>> 10 11 12 >>> 13 14 1

Re: Peek inside iterator (is there a PEP about this?)

2008-10-01 Thread Luis Zarrabeitia
On Wednesday 01 October 2008 01:14:14 pm Peter Otten wrote: > Luis Zarrabeitia wrote: > > a = iter([1,2,3,4,5]) # assume you got the iterator from a function and > > b = iter([1,2,3]) # these two are just examples. > > Can you provide a concrete use case? I'd like to... but I've refactored awa

Re: Event-driven framework (other than Twisted)?

2008-10-01 Thread James Mills
On Thu, Oct 2, 2008 at 2:09 AM, Bruno Desthuilliers <[EMAIL PROTECTED]> wrote: > "view" doesn't imply (x)html - any valid HTTP response is ok. The whole > point of decoupling controler from view (in web MVC) is to allow the same > controler to return different views. There is an alternative to the

Re: Event-driven framework (other than Twisted)?

2008-10-01 Thread James Mills
On Wed, Oct 1, 2008 at 6:55 PM, Phillip B Oldham <[EMAIL PROTECTED]> wrote: > I've noticed that. I'm thinking more for a web environment (instead of > MVC) or as a HTTP server. I know Twisted has TwistedWeb, but I'm > looking for alternatives. Again with pymills, here's an alternative: http://hg.

Re: Event-driven framework (other than Twisted)?

2008-10-01 Thread James Mills
On Wed, Oct 1, 2008 at 6:01 PM, Phillip B Oldham <[EMAIL PROTECTED]> wrote: > Are there any python event driven frameworks other than twisted? Phillip, I have been developing a rather unique event-driven and component architecture library for quite some time that is (not twisted). Actually it's no

megarotic - Free2

2008-10-01 Thread wugivensnolan
megarotic . . . ***CLICK HERE http://vids365.cn/megarotic * . . . . . . . . . . . . megarotic -- http://mail.python.org/mailman/listinfo/python-list

Re: How to emit UTF-8 from console mode?

2008-10-01 Thread Ross Ridge
> I need UTF-8 because I need to experiment with some OS function calls that > give me UTF-16 and I need to emit UTF-16 or UTF-8. <[EMAIL PROTECTED]> wrote: >Try setting the code page to 65001, and emit the UTF-8 explicitly. Hmm... apparently that's not allowed on Windows XP: C:\> chcp 65001 Ac

Database GUI generation from schema

2008-10-01 Thread Eric Wertman
Sorry if this is misplaced, but I could have sworn I saw a link on this list to a package that would auto-generate data entry type forms from a database schema, similar to django's auto-admin interface. Does anyone recall a package like that? I did some searching, but I've only found documentatio

Searching for Happiness

2008-10-01 Thread kaka
Excuse me!! Would you stop for a moment?! O...man...Haven't you thought-one day- about yourself ? Who has made it? Have you seen a design which hasn't a designer ?! Have you seen a wonderful,delicate work without a worker ?! It's you and the whole universe!.. Who has made them all ?!! You know who

megarotic asian - Free

2008-10-01 Thread Albertos
megarotic asian . . . ***CLICK HERE http://vids365.cn/megarotic-asian * . . . . . . . . . . . . megarotic asian -- http://mail.python.org/mailman/listinfo/python-list

megarotic login - Free

2008-10-01 Thread Albertos
megarotic login . . . ***CLICK HERE http://vids365.cn/megarotic-login * . . . . . . . . . . . . megarotic login -- http://mail.python.org/mailman/listinfo/python-list

megarotic pass - Free

2008-10-01 Thread Albertos
megarotic pass . . . ***CLICK HERE http://vids365.cn/megarotic-pass * . . . . . . . . . . . . megarotic pass -- http://mail.python.org/mailman/listinfo/python-list

www megarotic - Free

2008-10-01 Thread Albertos
www megarotic . . . ***CLICK HERE http://vids365.cn/www-megarotic * . . . . . . . . . . . . www megarotic -- http://mail.python.org/mailman/listinfo/python-list

www megarotic - Free

2008-10-01 Thread Albertos
www megarotic . . . ***CLICK HERE http://vids365.cn/www-megarotic * . . . . . . . . . . . . www megarotic -- http://mail.python.org/mailman/listinfo/python-list

megarotic hot - Free

2008-10-01 Thread Albertos
megarotic hot . . . ***CLICK HERE http://vids365.cn/megarotic-hot * . . . . . . . . . . . . megarotic hot -- http://mail.python.org/mailman/listinfo/python-list

megarotic rar - Free

2008-10-01 Thread Albertos
megarotic rar . . . ***CLICK HERE http://vids365.cn/megarotic-rar * . . . . . . . . . . . . megarotic rar -- http://mail.python.org/mailman/listinfo/python-list

megarotic ip - Free

2008-10-01 Thread Albertos
megarotic ip . . . ***CLICK HERE http://vids365.cn/megarotic-ip * . . . . . . . . . . . . megarotic ip -- http://mail.python.org/mailman/listinfo/python-list

megarotic - Free

2008-10-01 Thread Albertos
megarotic . . . ***CLICK HERE http://vids365.cn/megarotic * . . . . . . . . . . . . megarotic -- http://mail.python.org/mailman/listinfo/python-list

Re: Are there any free source for matrix diagonalization?

2008-10-01 Thread Tim Daneliuk
Kurda Yon wrote: > Hi, > > Does Python have a free source community for the numerical problems > coding? I mean, are there some web-sites where I could find a free > code for such problems like calculation of eigenvectors and > eigenvalues of matrices? > > Thank you! Try here: http://numpy.scip

Re: Are there any free source for matrix diagonalization?

2008-10-01 Thread Terry Reedy
Kurda Yon wrote: Hi, Does Python have a free source community for the numerical problems coding? I mean, are there some web-sites where I could find a free code for such problems like calculation of eigenvectors and eigenvalues of matrices? Did you try searching, say with Google? "Python numer

Re: Tkinter on WIndows XP opens a blank screen. How can I get rid of it?

2008-10-01 Thread Jerry Hill
On Wed, Oct 1, 2008 at 5:02 PM, Chris Rebert <[EMAIL PROTECTED]> wrote: > Run your script using pythonw.exe instead of python.exe ; it doesn't open a > console window and exists for this exact purpose. In particular, you can just rename your script from "myscript.py" to "myscript.pyw". Then when

Are there any free source for matrix diagonalization?

2008-10-01 Thread Kurda Yon
Hi, Does Python have a free source community for the numerical problems coding? I mean, are there some web-sites where I could find a free code for such problems like calculation of eigenvectors and eigenvalues of matrices? Thank you! -- http://mail.python.org/mailman/listinfo/python-list

docstrings => RestructuredText => Sphinx => Nice html docs (?)

2008-10-01 Thread Infinity77
Hi All, I apologize in advance if my question sounds dumb. I googled back and forth but my google-fu today is not working very well... I have seen the new style Python html documentation, which is extremely nice, and by reading here and there I have seen that it has been generated using Georg

Re: Socket Question

2008-10-01 Thread [EMAIL PROTECTED]
Maybe you need to close the socket somewhere else, rather than to close it when you receive the your response. On 9月30日, 上午7时01分, Ali Hamad <[EMAIL PROTECTED]> wrote: > Hello All : > > A socket question from a networking newbie. I need to create > a server that: > > 1) receive a message from clien

Re: Tkinter on WIndows XP opens a blank screen. How can I get rid of it?

2008-10-01 Thread Chris Rebert
Run your script using pythonw.exe instead of python.exe ; it doesn't open a console window and exists for this exact purpose. Cheers, Chris Rebert On Sep 30, 2008, at 1:28 PM, [EMAIL PROTECTED] wrote: Hi, I m using Tkinter and Tix to create a GUI on Windows XP. So far I've created the GU

Re: Socket Question

2008-10-01 Thread Leon Zhang
Maybe you need to close the socket somewhere else, rather than to close it when you receive the your response. On Tue, Sep 30, 2008 at 7:01 AM, Ali Hamad <[EMAIL PROTECTED]> wrote: > Hello All : > > A socket question from a networking newbie. I need to create > a server that: > > 1) receive a me

Re: TypeError: can't pickle HASH objects?

2008-10-01 Thread mdsherry
On Oct 1, 3:50 pm, est <[EMAIL PROTECTED]> wrote: > >>> import md5 > >>> a=md5.md5() > >>> import pickle > >>> pickle.dumps(a) > > Traceback (most recent call last): >   File "", line 1, in >   File "C:\Python25\lib\pickle.py", line 1366, in dumps >     Pickler(file, protocol).dump(obj) >   File "

RE: decent interactive python shell on MS Windows?

2008-10-01 Thread Reedick, Andrew
> -Original Message- > From: [EMAIL PROTECTED] [mailto:python- > [EMAIL PROTECTED] On Behalf Of > [EMAIL PROTECTED] > Sent: Wednesday, October 01, 2008 12:54 PM > To: python-list@python.org > Subject: decent interactive python shell on MS Windows? > Is there an interactive Python shell

Re: What is not objects in Python?

2008-10-01 Thread Boris Borcic
42, for instance. Proof : >>> 42 is not object True QED -- http://mail.python.org/mailman/listinfo/python-list

Tkinter on WIndows XP opens a blank screen. How can I get rid of it?

2008-10-01 Thread dudeja . rajat
Hi, I m using Tkinter and Tix to create a GUI on Windows XP. So far I've created the GUI and it just works. But the problem is as soon as I double click on the script it besides opening the GUI also opens a shell ( a blank screen) with it. Pleas suggest how can I get rid of this blank screen.

Re: [Tutor] Replacing cmd.exe with custom .py application

2008-10-01 Thread Tim Golden
Ezra Taylor wrote: Is there something similar to /dev/null on Windows? NUL: TJG -- http://mail.python.org/mailman/listinfo/python-list

why? __builtins__ key added from eval

2008-10-01 Thread William Purcell
I want to use eval to evaluate wx.TextCtrl inputs. How can I keep python from adding the __builtins__ key to mydict when I use it with eval? Other wise I have to __delitem__('__builtins__') everytime I use eval? >>> mydict = {'a':2,'b':3} >>> eval('a*b',mydict) 6 >>> mydict {'a': 2, '__builtins__'

Socket Question

2008-10-01 Thread Ali Hamad
Hello All : A socket question from a networking newbie. I need to create a server that: 1) receive a message from client. 2) check that message and response to it. 3) the client get the server message and send another message. 4) finally, the server receive the message and close the connection.

Re: string concatenate

2008-10-01 Thread Terry Reedy
sandric ionut wrote: I have the following situation: nameAll = [] for i in range(1,10,1): n = "name" + str([i]) nameAll += n print nameAll nameAll = [] for i in range(1,11): n = "name" + str(i) nameAll.append(n) print(' '.join(nameAll)) #3.0 #prints name1 na

Re: How to give a global variable to a function which is in a module?

2008-10-01 Thread Terry Reedy
Kurda Yon wrote: Hi, I would like to declare a global variable, which is seen to a particular function. If I do as the following it works: x = 1 def test(): global x print x return 1 If you are just reading x, the global statement does nothing and is not needed. However, it does not

Re: Peek inside iterator (is there a PEP about this?)

2008-10-01 Thread Terry Reedy
Luis Zarrabeitia wrote: Hi there. For most use cases I think about, the iterator protocol is more than enough. However, on a few cases, I've needed some ugly hacks. Ex 1: a = iter([1,2,3,4,5]) # assume you got the iterator from a function and b = iter([1,2,3]) # these two are just exampl

TypeError: can't pickle HASH objects?

2008-10-01 Thread est
>>> import md5 >>> a=md5.md5() >>> import pickle >>> pickle.dumps(a) Traceback (most recent call last): File "", line 1, in File "C:\Python25\lib\pickle.py", line 1366, in dumps Pickler(file, protocol).dump(obj) File "C:\Python25\lib\pickle.py", line 224, in dump self.save(obj) Fil

Re: decent interactive python shell on MS Windows?

2008-10-01 Thread Stef Mientki
Jason Scheirer wrote: On Oct 1, 9:53 am, [EMAIL PROTECTED] wrote: Hi everyone, After having used Python on Linux for some time, I now have to do Python coding on Windows. I am big fan of the interactive Python shell to test, eg, regexps. Is there an interactive Python shell on Windows that

Re: decent interactive python shell on MS Windows?

2008-10-01 Thread james . kirin39
On Oct 1, 3:10 pm, Jason Scheirer <[EMAIL PROTECTED]> wrote: > On Oct 1, 9:53 am, [EMAIL PROTECTED] wrote: > > > > > Hi everyone, > > > After having used Python on Linux for some time, I now have to do > > Python coding on Windows. I am big fan of the interactive Python shell > > to test, eg, regex

Re: How to emit UTF-8 from console mode?

2008-10-01 Thread Martin v. Löwis
> But what are we doing here? Can you convince me that we are emitting UTF-8? Most definitely not. We are emitting cp1251. > I need UTF-8 because I need to experiment with some OS function calls that > give me UTF-16 and I need to emit UTF-16 or UTF-8. Try setting the code page to 65001, and e

Re: decent interactive python shell on MS Windows?

2008-10-01 Thread Jason Scheirer
On Oct 1, 9:53 am, [EMAIL PROTECTED] wrote: > Hi everyone, > > After having used Python on Linux for some time, I now have to do > Python coding on Windows. I am big fan of the interactive Python shell > to test, eg, regexps. > > Is there an interactive Python shell on Windows that supports: > > -

Re: Peek inside iterator (is there a PEP about this?)

2008-10-01 Thread Aaron "Castironpi" Brady
On Oct 1, 9:46 am, Luis Zarrabeitia <[EMAIL PROTECTED]> wrote: > Hi there. > > For most use cases I think about, the iterator protocol is more than enough. > However, on a few cases, I've needed some ugly hacks. > > Ex 1: > > a = iter([1,2,3,4,5]) # assume you got the iterator from a function and >

Re: Are there any python micro-frameworks (like ruby's Camping)?

2008-10-01 Thread Fred Pacquier
Phillip B Oldham <[EMAIL PROTECTED]> said : > On Oct 1, 10:29 am, Michele Simionato <[EMAIL PROTECTED]> > wrote: >> How about wsgiref in the standard library? It is as small as you can >> get without resorting to CGI. > > Interesting... I'll be sure to check that out also. > > Someone also menti

Re: Event-driven framework (other than Twisted)?

2008-10-01 Thread Phillip B Oldham
On Oct 1, 6:53 pm, Lie Ryan <[EMAIL PROTECTED]> wrote: > In fact, MVC and event-driven is two entirely different concept. You can > have both, or none. It is, in the end, your choice which one to use or > whether you want to use both or none. > > Event-driven programming is a concept that your prog

Re: decent interactive python shell on MS Windows?

2008-10-01 Thread Todd Whiteman
[EMAIL PROTECTED] wrote: Hi everyone, After having used Python on Linux for some time, I now have to do Python coding on Windows. I am big fan of the interactive Python shell to test, eg, regexps. Is there an interactive Python shell on Windows that supports: - easy copy-pasting to/from an edi

Re: Meetup in "Rapid prototyping in business & social networking in python"

2008-10-01 Thread Victor Bay
Hi, pythoners, I am planning a face-to-face meetup on RAD with python: http://python.meetup.com/190/ Depends on the time commitment frame of python developers, we meet monthly, weekly, or even daily, at convenient place like coffee society, library, bookstore, ..., etc. I will also be trying to

Re: Peek inside iterator (is there a PEP about this?)

2008-10-01 Thread George Sakkis
On Oct 1, 10:46 am, Luis Zarrabeitia <[EMAIL PROTECTED]> wrote: > Hi there. > > For most use cases I think about, the iterator protocol is more than enough. > However, on a few cases, I've needed some ugly hacks. > > Ex 1: > > a = iter([1,2,3,4,5]) # assume you got the iterator from a function and

Re: What is not objects in Python?

2008-10-01 Thread Aaron "Castironpi" Brady
On Sep 30, 7:39 am, Steve Holden <[EMAIL PROTECTED]> wrote: > Steven D'Aprano wrote: > > On Mon, 29 Sep 2008 21:03:07 -0700, namekuseijin wrote: > > >>> Why isn't len implemented as a str.len and list.len method instead of a > >>> len(list) function? > >> Because postfix notation sucks.  The natura

Re: string concatenate

2008-10-01 Thread Lie Ryan
On Wed, 01 Oct 2008 09:41:57 -0700, sandric ionut wrote: > Hi: > > I have the following situation: >     nameAll = [] Here you defined nameAll as a list >     for i in range(1,10,1): That range is superfluous, you could write this instead[1]: for i in range(10): >     n = "name" + str([i])

Re: closures and dynamic binding

2008-10-01 Thread Aaron "Castironpi" Brady
On Oct 1, 5:43 am, jhermann <[EMAIL PROTECTED]> wrote: > I didn't see this mentioned in the thread yet: the double-lambda is > unnecessary (and a hack). What you should do when you need early > binding is... early binding. ;) > > Namely: > > f = [lambda n=n: n for n in range(10)] > print f[0]() > p

Re: decent interactive python shell on MS Windows?

2008-10-01 Thread David
Il Wed, 1 Oct 2008 09:53:48 -0700 (PDT), [EMAIL PROTECTED] ha scritto: > Is there an interactive Python shell on Windows that supports: > > - easy copy-pasting to/from an editor? (as opposed to the cumbersome > "mark", "copy" and then "paste" sequence that any terminal on Windows > seems forced t

Re: Event-driven framework (other than Twisted)?

2008-10-01 Thread John Krukoff
You could take a look at this interesting looking server that popped up on the mailing list a while back: http://code.google.com/p/yield/ On Wed, 2008-10-01 at 01:01 -0700, Phillip B Oldham wrote: > Are there any python event driven frameworks other than twisted? > -- > http://mail.python.org/mai

Re: How to emit UTF-8 from console mode?

2008-10-01 Thread Lie Ryan
On Wed, 01 Oct 2008 08:17:15 -0700, Siegfried Heintze wrote: (snip) > The code was a little confusing because those two apostrophes look like > a double quote! Tips: use mono-spaced font. There is no ambiguity. (snip) > I think part of the problem is that Lucida Console is not as capable as

Re: problem with "ImportError: No module named..." and sockets

2008-10-01 Thread Daniel
On Sep 30, 5:49 pm, "Gabriel Genellina" <[EMAIL PROTECTED]> wrote: > En Tue, 30 Sep 2008 19:44:51 -0300, Daniel <[EMAIL PROTECTED]>   > escribió: > > > > > On Sep 30, 4:17 pm, "Gabriel Genellina" <[EMAIL PROTECTED]> > > wrote: > >> En Tue, 30 Sep 2008 18:38:19 -0300, Daniel <[EMAIL PROTECTED]>   >

Re: Event-driven framework (other than Twisted)?

2008-10-01 Thread Lie Ryan
On Wed, 01 Oct 2008 18:09:20 +0200, Bruno Desthuilliers wrote: > Phillip B Oldham a écrit : >> On Oct 1, 4:12 pm, Thomas Guettler <[EMAIL PROTECTED]> wrote: >>> Please explain what you want to do. >> >> I'm primarily looking for alternatives to MVC frameworks for web >> development, particularly

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

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

Re: parse a normal textfile

2008-10-01 Thread Lie Ryan
On Wed, 01 Oct 2008 14:09:09 +0200, Tino Wildenhain wrote: > devi thapa wrote: >> hi all >> >>I have one normal text file. I need to parse the file, that >> too in an associative way . >> suppose that below is the normal textfile >> >> name='adf' >> id =1 >> value=344 >> >> > the

Re: what does "python -i" use as input stream (stdin)?

2008-10-01 Thread Almar Klein
Hello again, I wanted to give your solution a try, but got stuck. The file that I want to replace the "standard input" with is a pseudo file object with a custom read method. I have a hard time finding out how to have a file descriptor (or fileno) associated with it. I tried inheriting from the "f

Re: Isolated environment for execfile

2008-10-01 Thread Lie Ryan
On Wed, 01 Oct 2008 11:11:29 +, Igor Kaplan wrote: > Hello python gurus. > > I got quite unusual problem and all my searches to find the answer on > my > own were not successful. > Here is the scenario: > I have the python program, let's call it script1.py, this program > needs to >

Re: Peek inside iterator (is there a PEP about this?)

2008-10-01 Thread Lie Ryan
On Wed, 01 Oct 2008 10:46:33 -0400, Luis Zarrabeitia wrote: > Hi there. > > For most use cases I think about, the iterator protocol is more than > enough. However, on a few cases, I've needed some ugly hacks. > > Ex 1: > > a = iter([1,2,3,4,5]) # assume you got the iterator from a function and

Re: Peek inside iterator (is there a PEP about this?)

2008-10-01 Thread Peter Otten
Luis Zarrabeitia wrote: > For most use cases I think about, the iterator protocol is more than > enough. However, on a few cases, I've needed some ugly hacks. > > Ex 1: > > a = iter([1,2,3,4,5]) # assume you got the iterator from a function and > b = iter([1,2,3]) # these two are just exampl

Re: Fwd: string concatenate

2008-10-01 Thread D'Arcy J.M. Cain
On Wed, 1 Oct 2008 10:03:50 -0700 (PDT) sandric ionut <[EMAIL PROTECTED]> wrote: > Thank you: >   > but I would like to have them not like: > ['name1', 'name2', 'name3', 'name4', 'name5', 'name6', 'name7',  > 'name8', 'name9'] >   > but like > name1 name2 name3 name4 name5 name6 name7 name8 name9

Re: decent interactive python shell on MS Windows?

2008-10-01 Thread Gary Herron
[EMAIL PROTECTED] wrote: > Hi everyone, > > After having used Python on Linux for some time, I now have to do > Python coding on Windows. I am big fan of the interactive Python shell > to test, eg, regexps. > > Is there an interactive Python shell on Windows that supports: > > - easy copy-pasting t

Re: decent interactive python shell on MS Windows?

2008-10-01 Thread Tim Golden
[EMAIL PROTECTED] wrote: Is there an interactive Python shell on Windows that supports: - easy copy-pasting to/from an editor? (as opposed to the cumbersome "mark", "copy" and then "paste" sequence that any terminal on Windows seems forced to adopt) - readline-like command history (up/down for

Re: Fwd: string concatenate

2008-10-01 Thread sandric ionut
Thank you:   but I would like to have them not like: ['name1', 'name2', 'name3', 'name4', 'name5', 'name6', 'name7',  'name8', 'name9']   but like name1 name2 name3 name4 name5 name6 name7 name8 name9   Is it possible?   Ionut - Original Message From: Tommy Grav <[EMAIL PROTECTED]> To:

decent interactive python shell on MS Windows?

2008-10-01 Thread james . kirin39
Hi everyone, After having used Python on Linux for some time, I now have to do Python coding on Windows. I am big fan of the interactive Python shell to test, eg, regexps. Is there an interactive Python shell on Windows that supports: - easy copy-pasting to/from an editor? (as opposed to the cum

Re: string concatenate

2008-10-01 Thread D'Arcy J.M. Cain
On Wed, 1 Oct 2008 09:41:57 -0700 (PDT) sandric ionut <[EMAIL PROTECTED]> wrote: > Hi: > > I have the following situation: >     nameAll = [] >     for i in range(1,10,1): >     n = "name" + str([i]) >     nameAll += n >     print nameAll > > I get: > > ['n', 'a', 'm', 'e', '[', '1', ']'

Re: text file

2008-10-01 Thread Tim Golden
[EMAIL PROTECTED] wrote: HI all, i have some problem with the code belove, i have a list of servers in a textfile (elencopc.txt) i would to retrieve informations via WMI ( cicle for ), but i don't understand if the code is correct: Try this, using http://timgolden.me.uk/python/wmi.html :

Re: text file

2008-10-01 Thread Lie Ryan
On Wed, 01 Oct 2008 07:19:44 -0700, yqyq22 wrote: > My problem is how to translate this vbs in python: > > Dim fso > Dim strComputer > Set fso = CreateObject("Scripting.FileSystemObject") Set ElencoPC = > fso.OpenTextFile("elencoPC.txt" , 1, False) Do Until > ElencoPC.AtEndOfStream > strComputer =

Fwd: string concatenate

2008-10-01 Thread Tommy Grav
On Oct 1, 2008, at 12:41 PM, sandric ionut wrote: Hi: I have the following situation: nameAll = [] for i in range(1,10,1): n = "name" + str([i]) nameAll += n print nameAll I get: ['n', 'a', 'm', 'e', '[', '1', ']', 'n', 'a', 'm', 'e', '[', '2', ']', 'n', 'a', 'm', 'e'

Re: string concatenate

2008-10-01 Thread Tommy Grav
On Oct 1, 2008, at 12:41 PM, sandric ionut wrote: Hi: I have the following situation: nameAll = [] for i in range(1,10,1): n = "name" + str([i]) nameAll += n print nameAll I get: ['n', 'a', 'm', 'e', '[', '1', ']', 'n', 'a', 'm', 'e', '[', '2', ']', 'n', 'a', 'm

string concatenate

2008-10-01 Thread sandric ionut
Hi: I have the following situation:     nameAll = []     for i in range(1,10,1):     n = "name" + str([i])     nameAll += n     print nameAll I get: ['n', 'a', 'm', 'e', '[', '1', ']', 'n', 'a', 'm', 'e', '[', '2', ']', 'n', 'a', 'm', 'e', '[', '3', ']', 'n', 'a', 'm', 'e', '[', '4', ']

Re: indirectly addressing vars in Python

2008-10-01 Thread Lie Ryan
On Wed, 01 Oct 2008 10:53:08 -0400, Ross wrote: > Forgive my newbieness - I want to refer to some variables and indirectly > alter them. Not sure if this is as easy in Python as it is in C. > > Say I have three vars: oats, corn, barley > > I add them to a list: myList[{oats}, {peas}, {barley}

Re: Event-driven framework (other than Twisted)?

2008-10-01 Thread Bruno Desthuilliers
Phillip B Oldham a écrit : On Oct 1, 4:12 pm, Thomas Guettler <[EMAIL PROTECTED]> wrote: Please explain what you want to do. I'm primarily looking for alternatives to MVC frameworks for web development, particularly SAAS. I've looked around, and some whitepapers suggest that event-based framew

Re: How to give a global variable to a function which is in a module?

2008-10-01 Thread Bruno Desthuilliers
Kurda Yon a écrit : Hi, I would like to declare a global variable, which is seen to a particular function. First point : there's no real 'global' scope in Python. 'global' really means 'module-level'. Second point : globals are Bad(tm) anyway. If I do as the following it works: x = 1 def

Re: Event-driven framework (other than Twisted)?

2008-10-01 Thread Phillip B Oldham
On Oct 1, 4:12 pm, Thomas Guettler <[EMAIL PROTECTED]> wrote: > Please explain what you want to do. I'm primarily looking for alternatives to MVC frameworks for web development, particularly SAAS. I've looked around, and some whitepapers suggest that event-based frameworks often perform better tha

Re: indirectly addressing vars in Python

2008-10-01 Thread Bruno Desthuilliers
Chris Rebert a écrit : On Wed, Oct 1, 2008 at 7:53 AM, Ross <[EMAIL PROTECTED]> wrote: Forgive my newbieness - I want to refer to some variables and indirectly alter them. Not sure if this is as easy in Python as it is in C. Say I have three vars: oats, corn, barley I add them to a list: myL

How to give a global variable to a function which is in a module?

2008-10-01 Thread Kurda Yon
Hi, I would like to declare a global variable, which is seen to a particular function. If I do as the following it works: x = 1 def test(): global x print x return 1 However, it does not helps since my function is in a separate file. In other words I have a main program which has the follo

Re: change line with columns when print

2008-10-01 Thread MRAB
On Oct 1, 1:13 pm, "D'Arcy J.M. Cain" <[EMAIL PROTECTED]> wrote: > On Wed, 1 Oct 2008 04:43:34 -0700 (PDT) > > sandric ionut <[EMAIL PROTECTED]> wrote: > > > Hello: > > I have a text file that looks like: > > 0 23 > > 1 342 > > 3 31 > > and I want to read the file and print it out like: > > 0 1 3 >

Re: How to emit UTF-8 from console mode?

2008-10-01 Thread Siegfried Heintze
>Make sure you are using the Lucida Console font for the cmd.exe window and >type the commands: > >chcp 1251 >python -c "print ''.join(unichr(i) for i in range(0x410,0x431))" > >Output: > >? > Wowa! I was not aware of that chcp command! Thanks! How could I do that

  1   2   >