Re: dictionary with tuple keys

2009-12-14 Thread Paul Rubin
Brandon Devine writes: > I am probably not thinking straight anymore about this problem. I > have a dictionary with tuple keys in the format (a, b, A, B) and float > values. I want to collect all the keys with identical (a, b...), > disregarding whatever (... A, B) might be. Specifically, I wan

Re: treaps in python

2009-12-14 Thread Daniel Stutzbach
On Mon, Dec 14, 2009 at 10:49 PM, Dan Stromberg wrote: > Also, what's the best way to package something like this for consumption by > python-folk? There seem to be so many ways of packaging things anymore. > Are dist utils, a .deb and a .rpm the way to go? Right now, it's just > using make to

Re: dictionary with tuple keys

2009-12-14 Thread Ben Finney
Brandon Devine writes: > I am probably not thinking straight anymore about this problem. I have > a dictionary with tuple keys in the format (a, b, A, B) and float > values. I want to collect all the keys with identical (a, b...), > disregarding whatever (... A, B) might be. Specifically, I want

Re: What type of info do you capture about a user's environment for debugging?

2009-12-14 Thread Martijn Arts
On Mon, Dec 14, 2009 at 10:11 PM, Philip Semanchuk wrote: > > On Dec 14, 2009, at 3:39 PM, pyt...@bdurham.com wrote: > > We're preparing to release a commercial software product based on >> Python. When a customer reports problems with our software, we >> would like to capture as much information

Re: Dangerous behavior of list(generator)

2009-12-14 Thread Steven D'Aprano
On Mon, 14 Dec 2009 15:26:25 -0800, Carl Banks wrote: > On Dec 14, 2:48 pm, Steven D'Aprano cybersource.com.au> wrote: >> On Mon, 14 Dec 2009 14:31:44 +, exarkun wrote: >> > On 06:46 am, tjre...@udel.edu wrote: >> >>On 12/13/2009 10:29 PM, exar...@twistedmatrix.com wrote: >> >>>Doesn't matter

Re: Using Python to Execute a C or FORTRAN Program (Windows)

2009-12-14 Thread Mensanator
On Dec 14, 8:14�pm, "W. eWatson" wrote: > I think Python is capable of executing a compiled C or FORTRAN program, Sure, if it was compiled to an .exe file. > and maybe even getting some parameters passed back. Sure, if the program prints to stdout. > Does anyone have a > example of how this mi

Re: dictionary with tuple keys

2009-12-14 Thread Chris Rebert
On Mon, Dec 14, 2009 at 9:49 PM, Brandon Devine wrote: > Hi all, > > I am probably not thinking straight anymore about this problem.  I > have a dictionary with tuple keys in the format (a, b, A, B) and float > values.  I want to collect all the keys with identical (a, b...), > disregarding whatev

Re: What is the differences between tkinter in windows and Tkinter in the other platform?

2009-12-14 Thread Hidekazu IWAKI
Thank you for your point. Python versions were difficult. And I didn't know that Tkinter was renamed. To make sure, I specify their systems. The system which `tkinter` module has is python 3.11 in Windows XP SP3. And the other system, which `Tkinter` module has is python 2.51 in Ubuntu 8.04. I'

dictionary with tuple keys

2009-12-14 Thread Brandon Devine
Hi all, I am probably not thinking straight anymore about this problem. I have a dictionary with tuple keys in the format (a, b, A, B) and float values. I want to collect all the keys with identical (a, b...), disregarding whatever (... A, B) might be. Specifically, I want to sum the float valu

Re: print format

2009-12-14 Thread Gabriel Genellina
En Tue, 15 Dec 2009 00:28:11 -0300, Dave Angel escribió: mattia wrote: Hi all, I wanto to print just the first 5 characters of a string, why this doesn't work (py3.1)? print("{0:5}".format("123456789")) 123456789 I know I could use print("123456789"[:5]), yeah it's a stupid example, b

Re: treaps in python

2009-12-14 Thread Carl Banks
On Dec 14, 8:49 pm, Dan Stromberg wrote: > It's currently GPLv3-licensed, but I'd like to dual license it in such a > way that it could eventually be included in the standard library.  How > would I go about this? I'm not going to try to talk you out of dual licensing it as something other than G

treaps in python

2009-12-14 Thread Dan Stromberg
I've just released my treap.py module: http://stromberg.dnsalias.org/~dstromberg/treap/ It's code that implements a datastructure that is a hybrid of a binary tree and a binary heap, having some of the advantages of each. The URL has a table comparing the asymptotic performance of treaps aga

Re: read text file byte by byte

2009-12-14 Thread Terry Reedy
On 12/14/2009 7:37 PM, Gabriel Genellina wrote: En Mon, 14 Dec 2009 18:09:52 -0300, Nobody escribió: On Sun, 13 Dec 2009 22:56:55 -0800, sjdevn...@yahoo.com wrote: The 3.1 documentation specifies that file.read returns bytes: Does it need fixing? There are no file objects in 3.x. The fil

Re: read text file byte by byte

2009-12-14 Thread sjdevn...@yahoo.com
On Dec 14, 4:09 pm, Nobody wrote: > On Sun, 13 Dec 2009 22:56:55 -0800, sjdevn...@yahoo.com wrote: > > The 3.1 documentation specifies that file.read returns bytes: > > Does it need fixing? > > There are no file objects in 3.x. Then the documentation definitely needs fixing; the excerpt I posted

Re: print format

2009-12-14 Thread Dave Angel
mattia wrote: Hi all, I wanto to print just the first 5 characters of a string, why this doesn't work (py3.1)? print("{0:5}".format("123456789")) 123456789 I know I could use print("123456789"[:5]), yeah it's a stupid example, but isn't format for string formatting? Thanks, Matti

Re: OS independent way to check if a python app is running?

2009-12-14 Thread Dan Sommers
On Mon, 14 Dec 2009 14:14:05 -0500, python wrote: > Is there an os independent way to check if a python app is running? > > Goal: I have a server program based on cherrypy that I only want to have > running once. If a system administrator accidentally attempts to run > this program more than once

Re: Using Python to Execute a C or FORTRAN Program (Windows)

2009-12-14 Thread Stephen Hansen
On Mon, Dec 14, 2009 at 6:14 PM, W. eWatson wrote: > I think Python is capable of executing a compiled C or FORTRAN program, and > maybe even getting some parameters passed back. Does anyone have a example > of how this might be done? I'm running under Win XP Pro. > import subprocess proc = subp

Re: pyZui - anyone know about this?

2009-12-14 Thread David Roberts
Hi, Yes, the toolkit used is PyQt. The ZUI is implemented using a simple QPainter, and employs pyramidal tiling for efficiency (I haven't used any Qt/KDE voodoo in this regard). I'm using Gnome at the moment, but it should work just as well on KDE. Web pages are rendered using QtWebKit, and PDF wi

Using Python to Execute a C or FORTRAN Program (Windows)

2009-12-14 Thread W. eWatson
I think Python is capable of executing a compiled C or FORTRAN program, and maybe even getting some parameters passed back. Does anyone have a example of how this might be done? I'm running under Win XP Pro. -- http://mail.python.org/mailman/listinfo/python-list

Re: race/deadlock when creating a multiprocessing.manager instance while importing a module ?

2009-12-14 Thread Dave Angel
Sebastien Binet wrote: hi there, say I have this module ## farnsworth ## __all__ = [ 'mgr', 'maths', ] from multiprocessing.managers import BaseManager class MathsClass(object): def add(self, x, y): return x + y def mul(self, x, y): return x * y class My

Re: print format

2009-12-14 Thread MRAB
mattia wrote: Hi all, I wanto to print just the first 5 characters of a string, why this doesn't work (py3.1)? print("{0:5}".format("123456789")) 123456789 I know I could use print("123456789"[:5]), yeah it's a stupid example, but isn't format for string formatting? That's because it's the

Re: parse a string of parameters and values

2009-12-14 Thread Tim Chase
Gabriel Genellina wrote: Peter Otten escribió: bsneddon wrote: I am going to read a text file that is an export from a control system. It has lines with information like base=1 name="first one" color=blue I would like to put this info into a dictionary for processing. import shlex s = 'base=

multiprocessing callbacks?

2009-12-14 Thread Pete Hunt
Hey, everyone - I'm trying to use multiprocessing to create a process pool similar to multiprocessing.Pool, except that it works across multiple hosts. For various reasons, I would like the result of async_apply() to return a Twisted Deferred object. My first attempt at the implementation is: cl

Re: read text file byte by byte

2009-12-14 Thread Gabriel Genellina
En Mon, 14 Dec 2009 18:09:52 -0300, Nobody escribió: On Sun, 13 Dec 2009 22:56:55 -0800, sjdevn...@yahoo.com wrote: The 3.1 documentation specifies that file.read returns bytes: Does it need fixing? There are no file objects in 3.x. The file() function no longer exists. The return value f

Re: pyZui - anyone know about this?

2009-12-14 Thread Donn
On Tuesday 15 December 2009 01:43:52 David Boddie wrote: > I managed to catch his address and sent him a message saying that people > were discussing PyZUI in this thread. > Oooh. Sits,fidgets and waits. I want my socks back! (OP) :D \d -- \/\/ave: donn.in...@googlewave.com home: http://otherwis

Re: parse a string of parameters and values

2009-12-14 Thread Gabriel Genellina
En Sun, 13 Dec 2009 07:28:24 -0300, Peter Otten <__pete...@web.de> escribió: bsneddon wrote: I am going to read a text file that is an export from a control system. It has lines with information like base=1 name="first one" color=blue I would like to put this info into a dictionary for proc

Re: OS independent way to check if a python app is running?

2009-12-14 Thread python
Diez, Thank you for your sample code. That was just what we were looking for. Regards, Malcolm -- http://mail.python.org/mailman/listinfo/python-list

Re: pyZui - anyone know about this?

2009-12-14 Thread David Boddie
On Monday 14 December 2009 20:02, Donn wrote: > On Monday 14 December 2009 00:10:52 David Boddie wrote: >> Doesn't the author give his e-mail address at the end of the video? >> (Maybe I'm thinking of a different video.) >> > Yes, in a quick and garbled way :) I have yet to try to contact the aut

Re: Dangerous behavior of list(generator)

2009-12-14 Thread Carl Banks
On Dec 14, 2:48 pm, Steven D'Aprano wrote: > On Mon, 14 Dec 2009 14:31:44 +, exarkun wrote: > > On 06:46 am, tjre...@udel.edu wrote: > >>On 12/13/2009 10:29 PM, exar...@twistedmatrix.com wrote: > >>>Doesn't matter. Sometimes it makes sense to call it directly. > > >>It only makes sense to call

Re: insert unique data in a list

2009-12-14 Thread mattia
Il Mon, 14 Dec 2009 21:53:38 +, Steven D'Aprano ha scritto: > On Mon, 14 Dec 2009 17:13:24 +, mattia wrote: > >> Il Sun, 13 Dec 2009 21:17:28 -0800, knifenomad ha scritto: >> >>> On 12월14일, 오후12시42분, Steven D'Aprano >>> wrote: On Sun, 13 Dec 2009 17:19:17 -0800, knifenomad wrote: >

Re: Seek support for new slice syntax PEP.

2009-12-14 Thread Rhodri James
On Mon, 14 Dec 2009 18:40:38 -, Colin W. wrote: If your scheme flies, would it be practicable to use the same syntax as a range generator? range(i, j, k) => i:j:k so range(10, 2) => :10:2 i.e. we could write for i in :10:2: or the more common: range(10) => :10 Ugh. Magic characte

print format

2009-12-14 Thread mattia
Hi all, I wanto to print just the first 5 characters of a string, why this doesn't work (py3.1)? >>> print("{0:5}".format("123456789")) 123456789 I know I could use print("123456789"[:5]), yeah it's a stupid example, but isn't format for string formatting? Thanks, Mattia -- http://mail.python.o

Re: Dangerous behavior of list(generator)

2009-12-14 Thread Steven D'Aprano
On Mon, 14 Dec 2009 14:31:44 +, exarkun wrote: > On 06:46 am, tjre...@udel.edu wrote: >>On 12/13/2009 10:29 PM, exar...@twistedmatrix.com wrote: >>>Doesn't matter. Sometimes it makes sense to call it directly. >> >>It only makes sense to call next (or .__next__) when you are prepared to >>expl

Re: Parsing html with Beautifulsoup

2009-12-14 Thread Gabriel Genellina
En Mon, 14 Dec 2009 03:58:34 -0300, Johann Spies escribió: On Sun, Dec 13, 2009 at 07:58:55AM -0300, Gabriel Genellina wrote: cell.findAll(text=True) returns a list of all text nodes inside a cell; I preprocess all \n and   in each text node, and join them all. lines is a list of lists (each

Re: setup.py and PyPI

2009-12-14 Thread Ethan Furman
Philip Semanchuk wrote: On Dec 14, 2009, at 1:00 PM, Ethan Furman wrote: Philip Semanchuk wrote: On Dec 14, 2009, at 12:04 PM, Ethan Furman wrote: Greetings! I'm using Python 2.5 on Windows XP, and trying to get the upload portion of setup.py to work. According to what I have found, I

Re: Dangerous behavior of list(generator)

2009-12-14 Thread Carl Banks
On Dec 14, 7:21 am, exar...@twistedmatrix.com wrote: > Note, I know *why* the implementation leads to this behavior.  I'm > asking why "the devs" *accept* this. As noted, the problem isn't with generators but with iteration protocol. The devs "allowed" this because it was a necessary evil for cor

Re: insert unique data in a list

2009-12-14 Thread Steven D'Aprano
On Mon, 14 Dec 2009 17:13:24 +, mattia wrote: > Il Sun, 13 Dec 2009 21:17:28 -0800, knifenomad ha scritto: > >> On 12월14일, 오후12시42분, Steven D'Aprano >> wrote: >>> On Sun, 13 Dec 2009 17:19:17 -0800, knifenomad wrote: >>> > this makes the set type hashable. >>> >>> > class Set(set): >>> >    

Re: Seek support for new slice syntax PEP.

2009-12-14 Thread Nobody
On Mon, 14 Dec 2009 10:03:16 -0800, Dave wrote: > Just as sets may now be written as {3,'hi'}, I propose that slices > should be available using [start:end] syntax. Following example comes > from projecteuler.net problem 166. The Numeric community would also > like this, as would the general pyt

mock any instance

2009-12-14 Thread Phlip
Pythonistas: One important design principle is "construction encapsulation". That's where nobody creates anything, they always use things passed to them. Without this principle, when I need to mock the encapsulated item, some mock libraries provide an "any instance" facility. For example, here's

Re: Dangerous behavior of list(generator)

2009-12-14 Thread Antoine Pitrou
Le Mon, 14 Dec 2009 15:21:09 +, exarkun a écrit : > > I'm asking about why the behavior of a StopIteration exception being > handled from the `expression` of a generator expression to mean "stop > the loop" is accepted by "the devs" as acceptable. It's not "accepted as acceptable", it's just

Re: read text file byte by byte

2009-12-14 Thread Nobody
On Mon, 14 Dec 2009 03:14:11 +, MRAB wrote: >>> You originally stated that you want to "scramble" the bytes -- if >>> you mean to implement some sort of encryption algorithm you should know >>> that most of them work in blocks as the "key" is longer than one byte. >> >> Block ciphers work

Re: Seek support for new slice syntax PEP.

2009-12-14 Thread Carl Banks
On Dec 14, 10:03 am, Dave wrote: > Just as sets may now be written as {3,'hi'}, I propose that slices > should be available using [start:end] syntax.  Following example comes > from projecteuler.net problem 166.  The Numeric community would also > like this, as would the general python user.  The

Re: Seek support for new slice syntax PEP.

2009-12-14 Thread Steven D'Aprano
On Mon, 14 Dec 2009 13:40:38 -0500, Colin W. wrote: > Yes, we know that PEP 3003 applies but I see no harm in discussing > possible enhancements. You bored? Looking for something to do? I've lost all enthusiasm for discussing language enhancements, regardless of whether I'm for or against the

Re: read text file byte by byte

2009-12-14 Thread Nobody
On Sun, 13 Dec 2009 22:56:55 -0800, sjdevn...@yahoo.com wrote: > The 3.1 documentation specifies that file.read returns bytes: > Does it need fixing? There are no file objects in 3.x. The file() function no longer exists. The return value from open(), will be an instance of _io. depending upon t

Re: What type of info do you capture about a user's environment for debugging?

2009-12-14 Thread Philip Semanchuk
On Dec 14, 2009, at 3:39 PM, pyt...@bdurham.com wrote: We're preparing to release a commercial software product based on Python. When a customer reports problems with our software, we would like to capture as much information about their environment as possible while being respectful of privacy

Re: Moving from PHP to Python. Part Two

2009-12-14 Thread Terry Reedy
On 12/14/2009 2:49 PM, Jon Clements wrote: class Registry: data = {} def __init__(self,environ): self.data['env'] = environ self.data['init'] = 'hede' def set_entry(self,key,data): self.data[key] = data de

Re: OS independent way to check if a python app is running?

2009-12-14 Thread Diez B. Roggisch
MRAB schrieb: pyt...@bdurham.com wrote: Is there an os independent way to check if a python app is running? Goal: I have a server program based on cherrypy that I only want to have running once. If a system administrator accidentally attempts to run this program more than once, I would like

What type of info do you capture about a user's environment for debugging?

2009-12-14 Thread python
We're preparing to release a commercial software product based on Python. When a customer reports problems with our software, we would like to capture as much information about their environment as possible while being respectful of privacy concerns. The info we capture will be displayed to the use

Re: OS independent way to check if a python app is running?

2009-12-14 Thread python
Simon, > if True: >print "I'm running." > > ;-) LOL! Yes, I should of worded my original post better (meant to say "... if a python app is already running". Enjoyed your post anyway - I'm still laughing :) Cheers, Malcolm -- http://mail.python.org/mailman/listinfo/python-list

Re: OS independent way to check if a python app is running?

2009-12-14 Thread MRAB
pyt...@bdurham.com wrote: Is there an os independent way to check if a python app is running? Goal: I have a server program based on cherrypy that I only want to have running once. If a system administrator accidentally attempts to run this program more than once, I would like the 2nd instanc

Re: a huge shared read-only data in parallel accesses -- How? multithreading? multiprocessing?

2009-12-14 Thread Klauss
On Dec 11, 11:00 am, Antoine Pitrou wrote: > I was going to suggest memcached but it probably serializes non-atomic > types. Atomic as well. memcached communicates through sockets[3] (albeit possibly unix sockets, which are faster than TCP ones). multiprocessing has shared memory schemes, but doe

Re: read text file byte by byte

2009-12-14 Thread sjdevn...@yahoo.com
On Dec 14, 1:57 pm, Dennis Lee Bieber wrote: > On Sun, 13 Dec 2009 22:56:55 -0800 (PST), "sjdevn...@yahoo.com" > declaimed the following in > gmane.comp.python.general: > > > > > > > > > The 3.1 documentation specifies that file.read returns bytes: > > > file.read([size]) > >     Read at most siz

Re: md5 strange error

2009-12-14 Thread Mel
Rami Chowdhury wrote: > On Mon, Dec 14, 2009 at 09:33, catalinf...@gmail.com > wrote: >> now i have Fedora 12 >> Now when i try to use md5 , python say : >> python >> Python 2.6.2 (r262:71600, Aug 21 2009, 12:22:21) >> [GCC 4.4.1 20090818 (Red Hat 4.4.1-6)] on linux2 >> Type "help", "copyright", "

Re: OS independent way to check if a python app is running?

2009-12-14 Thread nopsidy
one way is you can create a lock file, then when the program start you check to see if this lock file exists. -Alex Goretoy -- http://mail.python.org/mailman/listinfo/python-list

Re: pyZui - anyone know about this?

2009-12-14 Thread Rami Chowdhury
On Mon, Dec 14, 2009 at 11:02, Donn wrote: > On Monday 14 December 2009 00:10:52 David Boddie wrote: >> Doesn't the author give his e-mail address at the end of the video? >> (Maybe I'm thinking of a different video.) >> > Yes, in a quick and garbled way :) I have yet to try to contact the author

Re: Moving from PHP to Python. Part Two

2009-12-14 Thread Jon Clements
> > class Registry: > >         data = {} > >         def __init__(self,environ): >                 self.data['env'] = environ >                 self.data['init'] = 'hede' > >         def set_entry(self,key,data): >                 self.data[key] = data > >         def get_entry(self,key): >      

Re: str and unicode proper usage

2009-12-14 Thread Lie Ryan
On 12/15/2009 5:05 AM, gizli wrote: Hi all, If an entire application operates on Unicode strings from UI to database, is there a use case for str() and unicode() functions? The application should be able to read/write files, open sockets and execute external processes and parse their output. Fro

Re: Seek support for new slice syntax PEP.

2009-12-14 Thread Lie Ryan
On 12/15/2009 5:03 AM, Dave wrote: Just as sets may now be written as {3,'hi'}, I propose that slices should be available using [start:end] syntax. Following example comes from projecteuler.net problem 166. The Numeric community would also like this, as would the general python user. The slice

race/deadlock when creating a multiprocessing.manager instance while importing a module ?

2009-12-14 Thread Sebastien Binet
hi there, say I have this module ## farnsworth ## __all__ = [ 'mgr', 'maths', ] from multiprocessing.managers import BaseManager class MathsClass(object): def add(self, x, y): return x + y def mul(self, x, y): return x * y class MyManager(BaseManager): p

Re: Moving from PHP to Python. Part Two

2009-12-14 Thread Jon Clements
On Dec 14, 12:55 pm, Sancar Saran wrote: > Hello Again. > > I hope, I don't bug too much. > > First of all. I want to Thank to everyone who respond my messages. > > I was able to do some of my needs and stuck some others. > > So ? I need help again. > > And here my progress.. > > Following was my

Re: insert unique data in a list

2009-12-14 Thread Lie Ryan
On 12/15/2009 4:13 AM, mattia wrote: > > of course it is broken as long as it uses it's instance id. i added this > to notify that unhashable can become hashable implementing __hash__ > inside the class. which probably set to None by default. Ok, nice example, but I believe that using id() as

Re: OS independent way to check if a python app is running?

2009-12-14 Thread Simon Brunning
2009/12/14 : > Is there an os independent way to check if a python app is running? if True: print "I'm running." ;-) -- Cheers, Simon B. -- http://mail.python.org/mailman/listinfo/python-list

Re: Seek support for new slice syntax PEP.

2009-12-14 Thread Terry Reedy
On 12/14/2009 1:10 PM, geremy condra wrote: http://www.python.org/dev/peps/pep-3003/ The moratorium does not stop proposals for things to be added after the moratorium ends. But it does show that Guido and the devs are reluctant to make *any* change to the core syntax of 3.x without really go

Re: str and unicode proper usage

2009-12-14 Thread Dave Angel
gizli wrote: Hi all, If an entire application operates on Unicode strings from UI to database, is there a use case for str() and unicode() functions? The application should be able to read/write files, open sockets and execute external processes and parse their output. From my own experiments,

Re: Seek support for new slice syntax PEP.

2009-12-14 Thread Terry Reedy
On 12/14/2009 1:03 PM, Dave wrote: Just as sets may now be written as {3,'hi'}, I propose that slices should be available using [start:end] syntax. I believe this has been proposed and rejected on one of the py-dev, py-ideas, or py-3k lists, but I would have to check to be sure. Extended sli

OS independent way to check if a python app is running?

2009-12-14 Thread python
Is there an os independent way to check if a python app is running? Goal: I have a server program based on cherrypy that I only want to have running once. If a system administrator accidentally attempts to run this program more than once, I would like the 2nd instance of the program to detect that

Python 2.6 ftplib has timeout parameter, but how to detect a timeout

2009-12-14 Thread Brendan
I was quite happy to see that ftplib in Python 2.6 now has a timeout parameter. With large file downloads my script would often hang, presumably from timing out. Now that there is a timeout parameter, how would I detect when a timeout occurs? -- http://mail.python.org/mailman/listinfo/python-list

Re: pyZui - anyone know about this?

2009-12-14 Thread geremy condra
might be related to this: http://code.google.com/p/rchi-zui/ geremy condra -- http://mail.python.org/mailman/listinfo/python-list

Re: Dangerous behavior of list(generator)

2009-12-14 Thread exarkun
On 06:00 pm, tjre...@udel.edu wrote: On 12/14/2009 10:21 AM, exar...@twistedmatrix.com wrote: I'm asking about why the behavior of a StopIteration exception being handled from the `expression` of a generator expression to mean "stop the loop" is accepted by "the devs" as acceptable. Any unhand

Re: pyZui - anyone know about this?

2009-12-14 Thread Donn
On Monday 14 December 2009 00:10:52 David Boddie wrote: > Doesn't the author give his e-mail address at the end of the video? > (Maybe I'm thinking of a different video.) > Yes, in a quick and garbled way :) I have yet to try to contact the author or the youtube poster -- been too busy. I was ho

Re: Seek support for new slice syntax PEP.

2009-12-14 Thread geremy condra
> Yes, we know that PEP 3003 applies but I see no harm in discussing possible > enhancements. I don't think the OP knew that the moratorium was in effect. That's why I brought it up. Geremy Condra -- http://mail.python.org/mailman/listinfo/python-list

Re: Seek support for new slice syntax PEP.

2009-12-14 Thread Colin W.
On 14-Dec-09 13:03 PM, Dave wrote: Just as sets may now be written as {3,'hi'}, I propose that slices should be available using [start:end] syntax. Following example comes from projecteuler.net problem 166. The Numeric community would also like this, as would the general python user. The slice

Re: setup.py and PyPI

2009-12-14 Thread Philip Semanchuk
On Dec 14, 2009, at 1:00 PM, Ethan Furman wrote: Philip Semanchuk wrote: On Dec 14, 2009, at 12:04 PM, Ethan Furman wrote: Greetings! I'm using Python 2.5 on Windows XP, and trying to get the upload portion of setup.py to work. According to what I have found, I can put my info into a

Re: setup.py and PyPI

2009-12-14 Thread Ethan Furman
Philip Semanchuk wrote: On Dec 14, 2009, at 12:04 PM, Ethan Furman wrote: Greetings! I'm using Python 2.5 on Windows XP, and trying to get the upload portion of setup.py to work. According to what I have found, I can put my info into a .pypirc file to have the process pick up my userna

Re: What is the differences between tkinter in windows and Tkinter in the other platform?

2009-12-14 Thread Terry Reedy
On 12/14/2009 10:02 AM, Hidekazu IWAKI wrote: > Hi, I'm hidekazu. > > I'm making a Tk application with python. > In the below code, the class App was inherited from Tkinter.Tk and the > __init__ method calls Tk's constructor with `super` method. In windows, > this code is valid (but, Tkinter -> t

Re: Seek support for new slice syntax PEP.

2009-12-14 Thread geremy condra
http://www.python.org/dev/peps/pep-3003/ Geremy Condra -- http://mail.python.org/mailman/listinfo/python-list

str and unicode proper usage

2009-12-14 Thread gizli
Hi all, If an entire application operates on Unicode strings from UI to database, is there a use case for str() and unicode() functions? The application should be able to read/write files, open sockets and execute external processes and parse their output. From my own experiments, the open() comma

Seek support for new slice syntax PEP.

2009-12-14 Thread Dave
Just as sets may now be written as {3,'hi'}, I propose that slices should be available using [start:end] syntax. Following example comes from projecteuler.net problem 166. The Numeric community would also like this, as would the general python user. The slice notation would require one ":" betwe

Re: Dangerous behavior of list(generator)

2009-12-14 Thread Terry Reedy
On 12/14/2009 10:21 AM, exar...@twistedmatrix.com wrote: I'm asking about why the behavior of a StopIteration exception being handled from the `expression` of a generator expression to mean "stop the loop" is accepted by "the devs" as acceptable. Any unhandled exception within a loop stops the

Re: md5 strange error

2009-12-14 Thread Rami Chowdhury
On Mon, Dec 14, 2009 at 09:33, catalinf...@gmail.com wrote: > now i have Fedora 12 > Now when i try to use md5 , python say : >  python > Python 2.6.2 (r262:71600, Aug 21 2009, 12:22:21) > [GCC 4.4.1 20090818 (Red Hat 4.4.1-6)] on linux2 > Type "help", "copyright", "credits" or "license" for more

Re: md5 strange error

2009-12-14 Thread catalinf...@gmail.com
now i have Fedora 12 Now when i try to use md5 , python say : python Python 2.6.2 (r262:71600, Aug 21 2009, 12:22:21) [GCC 4.4.1 20090818 (Red Hat 4.4.1-6)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import md5 __main__:1: DeprecationWarning: the md5 modul

Re: setup.py and PyPI

2009-12-14 Thread Philip Semanchuk
On Dec 14, 2009, at 12:04 PM, Ethan Furman wrote: Greetings! I'm using Python 2.5 on Windows XP, and trying to get the upload portion of setup.py to work. According to what I have found, I can put my info into a .pypirc file to have the process pick up my username/password and upload th

Re: insert unique data in a list

2009-12-14 Thread mattia
Il Sun, 13 Dec 2009 21:17:28 -0800, knifenomad ha scritto: > On 12월14일, 오후12시42분, Steven D'Aprano > wrote: >> On Sun, 13 Dec 2009 17:19:17 -0800, knifenomad wrote: >> > this makes the set type hashable. >> >> > class Set(set): >> >     __hash__ = lambda self: id(self) >> >> That's a *seriously* b

setup.py and PyPI

2009-12-14 Thread Ethan Furman
Greetings! I'm using Python 2.5 on Windows XP, and trying to get the upload portion of setup.py to work. According to what I have found, I can put my info into a .pypirc file to have the process pick up my username/password and upload the files. I have tried putting this file into the same

Re: Dangerous behavior of list(generator)

2009-12-14 Thread Mel
exar...@twistedmatrix.com wrote: [ ... ] it's as if a loop like this: > > for a in b: > c > > actually meant this: > > for a in b: > try: > c > except StopIteration: > break > > Note, I know *why* the implementation leads to this behavior.

Re: What is the differences between tkinter in windows and Tkinter in the other platform?

2009-12-14 Thread Peter Otten
Hidekazu IWAKI wrote: > Hi, I'm hidekazu. > > I'm making a Tk application with python. > In the below code, the class App was inherited from Tkinter.Tk and the > __init__ method calls Tk's constructor with `super` method. In windows, > this code is valid (but, Tkinter -> tkinter). > > Why does t

Re: Dangerous behavior of list(generator)

2009-12-14 Thread exarkun
On 02:58 pm, m...@egenix.com wrote: exar...@twistedmatrix.com wrote: On 08:45 am, tjre...@udel.edu wrote: Tom Machinski wrote: In most cases, `list(generator)` works as expected. Thus, `list()` is generally equivalent to `[ expression>]`. Here's a minimal case where this equivalence breaks,

What is the differences between tkinter in windows and Tkinter in the other platform?

2009-12-14 Thread Hidekazu IWAKI
Hi, I'm hidekazu. I'm making a Tk application with python. In the below code, the class App was inherited from Tkinter.Tk and the __init__ method calls Tk's constructor with `super` method. In windows, this code is valid (but, Tkinter -> tkinter). Why does this code happen a type error in not win

Re: Moving from PHP to Python. Part Two

2009-12-14 Thread Diez B. Roggisch
Sancar Saran wrote: > Hello Again. > > I hope, I don't bug too much. > > First of all. I want to Thank to everyone who respond my messages. > > I was able to do some of my needs and stuck some others. > > So ? I need help again. > > And here my progress.. > > Following was my globalized regi

Re: Dangerous behavior of list(generator)

2009-12-14 Thread M.-A. Lemburg
exar...@twistedmatrix.com wrote: > On 08:45 am, tjre...@udel.edu wrote: >> Tom Machinski wrote: >>> In most cases, `list(generator)` works as expected. Thus, >>> `list()` is generally equivalent to `[>> expression>]`. >>> >>> Here's a minimal case where this equivalence breaks, causing a serious >>

Re: Dangerous behavior of list(generator)

2009-12-14 Thread exarkun
On 06:46 am, tjre...@udel.edu wrote: On 12/13/2009 10:29 PM, exar...@twistedmatrix.com wrote: Doesn't matter. Sometimes it makes sense to call it directly. It only makes sense to call next (or .__next__) when you are prepared to explicitly catch StopIteration within a try..except construct.

Issues with multiprocessing

2009-12-14 Thread Joshi, Yateen
Hi, I am resending this as I am not seeing any response, can anyone help here? Hi, I have an application that uses multiprocessing pools (multiprocessing.Pool(processes=.)). There are multiple such pools and each pool has configurable number of processes. Once the process is spawned,

Re: power of explicit self?

2009-12-14 Thread Carl Banks
On Dec 12, 12:20 pm, Fire Crow wrote: > > It's not implemented in the compiler. There's a place in the runtime > > for invoking a method where the object is inserted at the beginning > > of the parameter list. IIRC, that's done by wrapping the function > > object. > > This is the source of Objects

Moving from PHP to Python. Part Two

2009-12-14 Thread Sancar Saran
Hello Again. I hope, I don't bug too much. First of all. I want to Thank to everyone who respond my messages. I was able to do some of my needs and stuck some others. So ? I need help again. And here my progress.. Following was my globalized registry solution # -*- coding: utf-8 -*- class

Re: Moving from PHP to Python. Is it Possible

2009-12-14 Thread Bruno Desthuilliers
r0g a écrit : Bruno Desthuilliers wrote: Sancar Saran a écrit : (snip) My problem is with PHP syntax and performance. I'm just trying to replicate my recepies in python... Python is not PHP, and trying to write PHP in Python won't buy you much except pain and frustration. I think people ar

Re: Dangerous behavior of list(generator)

2009-12-14 Thread Peter Otten
Terry Reedy wrote: > On 12/13/2009 11:33 PM, exar...@twistedmatrix.com wrote: >> This could provide behavior roughly equivalent to the behavior >> of a list comprehension. > > Impossible. The only serious option for consistency is to special case > list comps to also trap StopIteration raised in

Re: How can I get the target platform info of a dll with Python 3.1.1?

2009-12-14 Thread W00D00
On dec. 12, 03:18, "Gabriel Genellina" wrote: > En Fri, 11 Dec 2009 16:39:37 -0300, Isti   > escribió: > > > I have manydllfiles and I would like to select them into two > > different folders (PC and PPC). For this I need to know the target > > platform of thedllfile or any other details about it

Re: Dangerous behavior of list(generator)

2009-12-14 Thread Lie Ryan
On 12/14/09, exar...@twistedmatrix.com wrote: > On 02:50 am, lie.1...@gmail.com wrote: >>On 12/14/2009 9:45 AM, exar...@twistedmatrix.com wrote: >>>On 08:18 pm, st...@remove-this-cybersource.com.au wrote: On Sun, 13 Dec 2009 14:35:21 +, exarkun wrote: >>StopIteration is intended to be

Re: Moving from PHP to Python. Is it Possible

2009-12-14 Thread r0g
Bruno Desthuilliers wrote: > Sancar Saran a écrit : > (snip) >> My problem is with PHP syntax and performance. I'm just trying to >> replicate my recepies in python... > > Python is not PHP, and trying to write PHP in Python won't buy you much > except pain and frustration. I think people are b

Re: eiger replacement?

2009-12-14 Thread Robin Becker
On 12/12/2009 05:38, Tim Roberts wrote: Steven D'Aprano wrote: On Fri, 11 Dec 2009 17:45:24 +, Robin Becker wrote: The current hardware CPU: Intel(R) Pentium(R) 4 CPU 2.40GHz (2394.01-MHz 686-class CPU) [...] What does this have to do with Python? I'm guessing Robin had a slight add

  1   2   >