Re: iterators and views of lists

2009-12-15 Thread Brendan Miller
On Tue, Dec 15, 2009 at 9:09 PM, Terry Reedy wrote: > On 12/15/2009 10:39 PM, Brendan Miller wrote: >> I'm wondering if anyone has done work towards creating more powerful >> iterators for python, or creating some more pythonic equivalent. > > For sequences, integer indexes let you do anything you

Re: pyZui - anyone know about this?

2009-12-15 Thread David Roberts
PyZUI 0.1 has been released: http://da.vidr.cc/projects/pyzui/ On Dec 15, 12:29 pm, David Roberts wrote: > 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

Re: strptime not strict enough

2009-12-15 Thread Chris Rebert
On Tue, Dec 15, 2009 at 9:47 PM, Tim Roberts wrote: > Tobias Weber wrote: >> >>despite the directives for leading zero stime.strptime('09121', >>'%y%m%d') returns the first of December. Shouldn't it raise ValueError? > > Python merely calls the strptime function in your C run-time library.  If >

Re: strptime not strict enough

2009-12-15 Thread Tim Roberts
Tobias Weber wrote: > >despite the directives for leading zero stime.strptime('09121', >'%y%m%d') returns the first of December. Shouldn't it raise ValueError? Python merely calls the strptime function in your C run-time library. If it sucks, so will time.strptime. >Where do I get strict date

Wrapping paper, anyone ?

2009-12-15 Thread simon
#!/usr/bin/env python from math import * from random import * import cairo from cairo import Context Black = (0, 0, 0) White = (1, 1, 1) def rand(): return random()*2 - 1 def rotate(theta, x, y): x, y = x*cos(theta)-y*sin(theta), x*sin(theta)+y*cos(theta) return x, y def star(ctx

Re: iterators and views of lists

2009-12-15 Thread Terry Reedy
On 12/15/2009 10:39 PM, Brendan Miller wrote: I was trying to reimplement some of the c++ library of generic algorithms in c++ in python, but I was finding that this is problematic to do this in a generic way because there isn't any equivalent of c++'s forward iterators, random access iterators,

Re: pyZui - anyone know about this?

2009-12-15 Thread David Roberts
> > and employs pyramidal tiling for efficiency > > \me ... time to hit Wikipedia :) It involves scaling an image to various resolutions, and partitioning them into fixed-size tiles. It's roughly the same technique used by Google Maps/Earth. > It is very cool, but I would inject a note of caution

Re: csv reader

2009-12-15 Thread Gabriel Genellina
En Tue, 15 Dec 2009 19:12:01 -0300, Emmanuel escribió: Then my problem is diferent! In fact I'm reading a csv file saved from openoffice oocalc using UTF-8 encoding. I get a list of list (let's cal it tab) with the csv data. If I do: print tab[2][4] In ipython, I get: equação de Toricelli. Ta

Problems with gettext and msgfmt

2009-12-15 Thread JKPeck
I'm using Python 2.6 on Windows and having trouble with the charset in gettext. It seems to be so broken that I must be missing something. When I run msgfmt.py, as far as I can see it writes no charset information into the mo file. The actual po files are in utf-8 in this case and have a charset

Re: (OT) Where Are Cookies Stored?

2009-12-15 Thread Dave Angel
Victor Subervi wrote: Hi; I've googled, found where cookies are supposed to be, the folders and files don't exist. I've opened my latest and greatest FF and seen cookies in there, but when I search for the name of the cookie in the C: dir, it's not there...anywhere. I've made sure no folders/file

iterators and views of lists

2009-12-15 Thread Brendan Miller
I was trying to reimplement some of the c++ library of generic algorithms in c++ in python, but I was finding that this is problematic to do this in a generic way because there isn't any equivalent of c++'s forward iterators, random access iterators, etc. i.e. all python iterators are just input it

Re: pyZui - anyone know about this?

2009-12-15 Thread alex23
Donn wrote: > I find the notion of minute "hot" areas to be a little obscure -- Quick! Zoom > into the last full-stop, it's a whole word in there! This aspect reminds me of the Red Dwarf episode "Back to Reality", in which Rimmer is criticised for not finding information contained in a microdot h

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

2009-12-15 Thread pograph
On Dec 15, 2:57 am, Sebastien Binet wrote: > Dave, > > [..snip..] > On Tuesday 15 December 2009 02:49:00 Dave Angel wrote: > > > Since I don't see any other responses, I'll give my guess, even though > > I'm not very experienced with the multiprocessing module. > > > It's my understanding that thr

Re: AttributeError: logging module bug ?

2009-12-15 Thread Peter
What's the problem ? Please provide the config file "logging.cfg" to ease debugging. Peter Here it is, thanks for having a look Peter # supports no whitespace !!! [DEFAULT] logdir=/tmp logfile=python logging_server=localhost [loggers] keys=root,module,class,data,class_1,data_1,of_

Re: (OT) Where Are Cookies Stored?

2009-12-15 Thread r0g
r0g wrote: > Gabriel Genellina wrote: >> En Tue, 15 Dec 2009 12:30:23 -0300, Victor Subervi >> escribió: >> >>> I've googled, found where cookies are supposed to be, the folders and >>> files >>> don't exist. I've opened my latest and greatest FF and seen cookies in >>> there, but when I search fo

Re: Odd json encoding erro

2009-12-15 Thread Chris Rebert
On Tue, Dec 15, 2009 at 3:04 PM, Wells wrote: > Sorry- more detail- the actual problem is an exception thrown when > running str() on the value, like so: > a = u'St. Paul\u2019s School For Boys (MN) HS' print str(a) > Traceback (most recent call last): >  File "", line 1, in > UnicodeEn

Re: Odd json encoding erro

2009-12-15 Thread Wells
Sorry- more detail- the actual problem is an exception thrown when running str() on the value, like so: >>> a = u'St. Paul\u2019s School For Boys (MN) HS' >>> print str(a) Traceback (most recent call last): File "", line 1, in UnicodeEncodeError: 'ascii' codec can't encode character u'\u2019' i

Re: (OT) Where Are Cookies Stored?

2009-12-15 Thread r0g
Gabriel Genellina wrote: > En Tue, 15 Dec 2009 12:30:23 -0300, Victor Subervi > escribió: > >> I've googled, found where cookies are supposed to be, the folders and >> files >> don't exist. I've opened my latest and greatest FF and seen cookies in >> there, but when I search for the name of the c

Re: insert unique data in a list

2009-12-15 Thread Christian Tismer
On 12/14/09 2:24 AM, knifenomad wrote: On 12월14일, 오전10시19분, knifenomad wrote: On 12월14일, 오전2시57분, mattia wrote: Il Sun, 13 Dec 2009 16:37:20 +, mattia ha scritto: How can I insert non-duplicate data in a list? I mean, is there a particular option in the creat

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

2009-12-15 Thread r0g
pyt...@bdurham.com wrote: > 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 Quick and dirty way would be to keep a particular high numbered socket open. R

Re: (OT) Where Are Cookies Stored?

2009-12-15 Thread Steven D'Aprano
On Tue, 15 Dec 2009 13:03:07 -0300, Gabriel Genellina wrote: > En Tue, 15 Dec 2009 12:30:23 -0300, Victor Subervi > escribió: > >> I've googled, found where cookies are supposed to be, the folders and >> files don't exist. [...] > How the browser stores its cookies should be irrelevant. Whenever

Re: Seek support for new slice syntax PEP.

2009-12-15 Thread r0g
Terry Reedy wrote: > 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 synt

Re: Odd json encoding erro

2009-12-15 Thread Intchanter / Daniel Fackrell
On Dec 15, 3:03 pm, Wells wrote: > I get this exception when decoding a certain JSON string: > > 'ascii' codec can't encode character u'\u2019' in position 8: ordinal > not in range(128) > > The JSON data in question: > > http://mlb.com/lookup/json/named.player_info.bam?sport_code=%27mlb%27... > >

Re: Odd json encoding erro

2009-12-15 Thread Chris Rebert
On Tue, Dec 15, 2009 at 2:03 PM, Wells wrote: > I get this exception when decoding a certain JSON string: > > 'ascii' codec can't encode character u'\u2019' in position 8: ordinal > not in range(128) > > The JSON data in question: > > http://mlb.com/lookup/json/named.player_info.bam?sport_code=%27

ftplib retrlines timeout

2009-12-15 Thread Jennifer
I am writing a program that has a requirement for a timeout of retrlines after the connection established. I just wonder if timeout of ftplib.FTP('.xxx.com',username,password,timeout) will work for retrlines method after the connection established. Or socket.setdefaulttimeout will work in this

Re: csv reader

2009-12-15 Thread Emmanuel
Then my problem is diferent! In fact I'm reading a csv file saved from openoffice oocalc using UTF-8 encoding. I get a list of list (let's cal it tab) with the csv data. If I do: print tab[2][4] In ipython, I get: equação de Toricelli. Tarefa exercícios PVR 1 e 2 ; PVP 1 If I only do: tab[2][4]

Odd json encoding erro

2009-12-15 Thread Wells
I get this exception when decoding a certain JSON string: 'ascii' codec can't encode character u'\u2019' in position 8: ordinal not in range(128) The JSON data in question: http://mlb.com/lookup/json/named.player_info.bam?sport_code=%27mlb%27&player_id=%27489002%27 It's in the 'high_school' key

Re: csv reader

2009-12-15 Thread Jerry Hill
On Tue, Dec 15, 2009 at 4:24 PM, Emmanuel wrote: > I have a problem with csv.reader from the library csv. I'm not able to > import accentuated caracters. For example, I'm trying to import a > simple file containing a single word "equação" using the following > code: > > import csv > arquivoCSV='te

Re: AttributeError: logging module bug ?

2009-12-15 Thread Neil Cerutti
On 2009-12-15, Neil Cerutti wrote: > On 2009-12-15, Peter wrote: >> on python 2.6 the following code raises an AttributeError: >> >> #!/usr/bin/env python >> import os.path as p >> import logging, logging.config >> >> >> class Logger(object): >>def load_config(self): >> logging.config.fi

Re: csv reader

2009-12-15 Thread Chris Rebert
On Tue, Dec 15, 2009 at 1:24 PM, Emmanuel wrote: > I have a problem with csv.reader from the library csv. I'm not able to > import accentuated caracters. For example, I'm trying to import a > simple file containing a single word "equação" using the following > code: > > import csv > arquivoCSV='te

Re: treaps in python

2009-12-15 Thread Robert Kern
On 2009-12-14 22: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 would recommend simply using the Apache v2 license. The PSF will only accept cod

csv reader

2009-12-15 Thread Emmanuel
I have a problem with csv.reader from the library csv. I'm not able to import accentuated caracters. For example, I'm trying to import a simple file containing a single word "equação" using the following code: import csv arquivoCSV='test' a=csv.reader(open(arquivoCSV),delimiter=',') tab=[] for row

Re: Where is PyMethod_GET_CLASS in Python 3?

2009-12-15 Thread Terry Reedy
On 12/15/2009 11:08 AM, Infinity77 wrote: Hi All, When building C extensions In Python 2.X, there was a magical PyMethod_GET_CLASS implemented like this: #define PyMethod_GET_CLASS(meth) \ (((PyMethodObject *)meth) -> im_class) It looks like Python 3 has wiped out the "im_class"

Re: treaps in python

2009-12-15 Thread Terry Reedy
On 12/14/2009 11: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 stuff things in /us

Re: Calling Cookie Values

2009-12-15 Thread Grant Edwards
> On Tue, Dec 15, 2009 at 2:36 PM, MRAB > wrote: > > You've just created a cookie, but are trying to get a value without > having set it first! > > > LOL! Rewrote code thus: > > cookie = os.environ.get('HTTP_COOKIE') > if not cookie: > cookie

Re: AttributeError: logging module bug ?

2009-12-15 Thread Peter Otten
Peter wrote: > on python 2.6 the following code raises an AttributeError: > > #!/usr/bin/env python > import os.path as p > import logging, logging.config > > > class Logger(object): >def load_config(self): > logging.config.fileConfig(p.join(p.dirname(__file__),'logging.cfg')) > > log

Re: AttributeError: logging module bug ?

2009-12-15 Thread Neil Cerutti
On 2009-12-15, Peter wrote: > on python 2.6 the following code raises an AttributeError: > > #!/usr/bin/env python > import os.path as p > import logging, logging.config > > > class Logger(object): >def load_config(self): > logging.config.fileConfig(p.join(p.dirname(__file__),'logging.cfg

Re: Calling Cookie Values

2009-12-15 Thread Victor Subervi
On Tue, Dec 15, 2009 at 4:05 PM, MRAB wrote: > What you got from HTTP_COOKIE was a _string_ (or None). You then need to > turn it into a cookie: > >cookie_string = os.environ.get('HTTP_COOKIE') >if cookie_string: >cookie = Cookie.SimpleCookie(cookie_string) >... >else:

Re: Calling Cookie Values

2009-12-15 Thread MRAB
Victor Subervi wrote: On Tue, Dec 15, 2009 at 2:36 PM, MRAB > wrote: You've just created a cookie, but are trying to get a value without having set it first! LOL! Rewrote code thus: cookie = os.environ.get('HTTP_COOKIE') if not cookie: cookie

AttributeError: logging module bug ?

2009-12-15 Thread Peter
on python 2.6 the following code raises an AttributeError: #!/usr/bin/env python import os.path as p import logging, logging.config class Logger(object): def load_config(self): logging.config.fileConfig(p.join(p.dirname(__file__),'logging.cfg')) logger = Logger() logger.load_config() ==

Re: Calling Cookie Values

2009-12-15 Thread Victor Subervi
On Tue, Dec 15, 2009 at 2:36 PM, MRAB wrote: > You've just created a cookie, but are trying to get a value without > having set it first! > LOL! Rewrote code thus: cookie = os.environ.get('HTTP_COOKIE') if not cookie: cookie = Cookie.SimpleCookie() cExpires, cPath, cComment, cDomain

Re: dictionary with tuple keys

2009-12-15 Thread Brandon Devine
So grateful! Thanks to all. The breadth of Python continues to amaze me, as does your generosity. ("Relative clarity like relative beauty is in the eye of the beholder, and few parents have ugly children"... fantastic!) Brandon -- http://mail.python.org/mailman/listinfo/python-list

Re: Calling Cookie Values

2009-12-15 Thread MRAB
Victor Subervi wrote: Hi; import Cookie ... cookie = Cookie.SimpleCookie() cookieString = os.environ.get('HTTP_COOKIE') if not cookieString: cExpires, cPath, cComment, cDomain, cMaxAge, cVersion = myCookie() cookie['lastvisit'] = str(time.time()) The following lines aren't going

Re: Calling Cookie Values

2009-12-15 Thread Rami Chowdhury
On Tue, Dec 15, 2009 at 10:05, Victor Subervi wrote: > Hi; > > import Cookie > ... >   cookie = Cookie.SimpleCookie() >   cookieString = os.environ.get('HTTP_COOKIE') >   if not cookieString: [snip] >   else: >     cookieFlag = 'old' >     print cookie['lastvisit']['expires'].value What does cook

Calling Cookie Values

2009-12-15 Thread Victor Subervi
Hi; import Cookie ... cookie = Cookie.SimpleCookie() cookieString = os.environ.get('HTTP_COOKIE') if not cookieString: cExpires, cPath, cComment, cDomain, cMaxAge, cVersion = myCookie() cookie['lastvisit'] = str(time.time()) cookie['lastvisit']['expires'] = cExpires cookie['l

Re: pyqt4 eric4 generated gui custom dialog open

2009-12-15 Thread Detlev Offenbach
rewonka wrote: > Hi, > > I've made a little application with mainwindow and one dialog > (something like input dialog). > I can't open the input dialog from my mainwindow > > I tried to open the dialog with a button, here is a code: > @pyqtSignature("") > def on_BtnAdd_clicked(self): >

Re: good code to study

2009-12-15 Thread Aahz
In article <55477b4a-2095-4e52-9f1c-8337d421c...@j9g2000prh.googlegroups.com>, Michael wrote: > >I want to improve my knowledge of Python (note: I'm still on 2.5 or >2.6) by studying good existing code, especially GUI programs. Any >suggestions? I'm looking at the eric source code now, for starte

Re: Seek support for new slice syntax PEP.

2009-12-15 Thread Bearophile
Steven D'Aprano: > I've lost all enthusiasm for discussing language enhancements That's probably the main downside of the moratorium. Humans need to play some to keep their will to work and improve things. Bye, bearophile -- http://mail.python.org/mailman/listinfo/python-list

Re: accessing gmail

2009-12-15 Thread Intchanter / Daniel Fackrell
http://mail.google.com/support/bin/answer.py?hl=en&answer=77654 -- http://mail.python.org/mailman/listinfo/python-list

Re: read text file byte by byte

2009-12-15 Thread sjdevn...@yahoo.com
On Dec 14, 11:44 pm, Terry Reedy wrote: > 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: > > >>

Python-URL! - weekly Python news and links (Dec 15)

2009-12-15 Thread Gabriel Genellina
QOTW: "Plus, it's not something that's never foolproof." - Carl Banks, daring negater http://groups.google.com/group/comp.lang.python/msg/e8f3adbf2cc31514 Several graph libraries are available; which one is the best? maybe they should be merged? http://groups.google.com/g

Re: (OT) Where Are Cookies Stored?

2009-12-15 Thread Victor Subervi
On Tue, Dec 15, 2009 at 12:03 PM, Gabriel Genellina wrote: > En Tue, 15 Dec 2009 12:30:23 -0300, Victor Subervi < > victorsube...@gmail.com> escribió: > > > I've googled, found where cookies are supposed to be, the folders and >> files >> don't exist. I've opened my latest and greatest FF and see

Re: sys.stderr and PyErr_WriteUnraisable

2009-12-15 Thread Jan Langer
Jan Langer schrieb: Gabriel Genellina schrieb: En Tue, 15 Dec 2009 11:17:20 -0300, Jan Langer escribió: from test.test_support import captured_output with captured_output("stderr") as stderr: def g(): try: g() except RuntimeError,e: pass

Python-URL! - weekly Python news and links (Dec 15)

2009-12-15 Thread Cameron Laird
This installment, like all those for several months, was authored by Gabriel Genellina. We have hopes of correcting the attribution before year's-end. QOTW: "Plus, it's not something that's never foolproof." - Carl Banks, daring negater http://groups.google.com/group/comp.lang.python/msg/e8

Re: sys.stderr and PyErr_WriteUnraisable

2009-12-15 Thread Jan Langer
Gabriel Genellina schrieb: En Tue, 15 Dec 2009 11:17:20 -0300, Jan Langer escribió: from test.test_support import captured_output with captured_output("stderr") as stderr: def g(): try: g() except RuntimeError,e: pass g() print stderr

Where is PyMethod_GET_CLASS in Python 3?

2009-12-15 Thread Infinity77
Hi All, When building C extensions In Python 2.X, there was a magical PyMethod_GET_CLASS implemented like this: #define PyMethod_GET_CLASS(meth) \ (((PyMethodObject *)meth) -> im_class) It looks like Python 3 has wiped out the "im_class" attribute. Which is the alternative was to han

Re: (OT) Where Are Cookies Stored?

2009-12-15 Thread Gabriel Genellina
En Tue, 15 Dec 2009 12:30:23 -0300, Victor Subervi escribió: I've googled, found where cookies are supposed to be, the folders and files don't exist. I've opened my latest and greatest FF and seen cookies in there, but when I search for the name of the cookie in the C: dir, it's not ther

Re: (OT) Where Are Cookies Stored?

2009-12-15 Thread Victor Subervi
On Tue, Dec 15, 2009 at 11:42 AM, geremy condra wrote: > Was on the first[1], second, and third google hits for me. Also, given the > number of web-related questions you're asking, you may want to look > into evolt's lists[2]. > > Geremy Condra > > [1]: > http://askville.amazon.com/Firefox-store-

Re: sys.stderr and PyErr_WriteUnraisable

2009-12-15 Thread Gabriel Genellina
En Tue, 15 Dec 2009 11:17:20 -0300, Jan Langer escribió: from test.test_support import captured_output with captured_output("stderr") as stderr: def g(): try: g() except RuntimeError,e: pass g() print stderr.getvalue() I expect the i

(OT) Where Are Cookies Stored?

2009-12-15 Thread Victor Subervi
Hi; I've googled, found where cookies are supposed to be, the folders and files don't exist. I've opened my latest and greatest FF and seen cookies in there, but when I search for the name of the cookie in the C: dir, it's not there...anywhere. I've made sure no folders/files are hidden and I still

sys.stderr and PyErr_WriteUnraisable

2009-12-15 Thread Jan Langer
Hi all, I am using Python 2.6 and with the following code I expect a different result: from test.test_support import captured_output with captured_output("stderr") as stderr: def g(): try: g() except RuntimeError,e: pass g() print stderr.getva

pyqt4 eric4 generated gui custom dialog open

2009-12-15 Thread rewonka
Hi, I've made a little application with mainwindow and one dialog (something like input dialog). I can't open the input dialog from my mainwindow I tried to open the dialog with a button, here is a code: @pyqtSignature("") def on_BtnAdd_clicked(self): """ Open input dialog

Re: Interesting things of 'getattr' and 'setattr'

2009-12-15 Thread Stefan Behnel
Red Forks, 15.12.2009 13:19: > I don't know it is a feature, or implement detail: > > >>> class C(object): pass > ... > >>> c = C() > >>> setattr(c, ' ', 3) > >>> getattr(c, ' ') > 3 > >>> setattr(c, 'with blank', 4) > >>> getattr(c, 'with blank') > 4 > > getattr / setattr seems treat any string

Re: Seek support for new slice syntax PEP.

2009-12-15 Thread Anh Hai Trinh
>         > from numpy import s_ >         > s_[1:2:3] >         slice(1, 2, 3) >         > s_[1:2:3, ..., 4:5] >         (slice(1, 2, 3), Ellipsis, slice(4, 5, None)) > > Or would it be possible to define "slice" itself so that it implements > __getitem__ and __getslice__? Indeed! Python 2.6.4

Interesting things of 'getattr' and 'setattr'

2009-12-15 Thread Red Forks
I don't know it is a feature, or implement detail: >>> class C(object): pass ... >>> c = C() >>> setattr(c, ' ', 3) >>> getattr(c, ' ') 3 >>> setattr(c, 'with blank', 4) >>> getattr(c, 'with blank') 4 getattr / setattr seems treat any string as attribute name. -- http://mail.python.org/mailman/l

Re: print format

2009-12-15 Thread Dave Angel
Gabriel Genellina wrote: 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 i

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

2009-12-15 Thread Sebastien Binet
Dave, [..snip..] On Tuesday 15 December 2009 02:49:00 Dave Angel wrote: > Since I don't see any other responses, I'll give my guess, even though > I'm not very experienced with the multiprocessing module. > > It's my understanding that threads may not be created or destroyed > during an import.

Re: pyZui - anyone know about this?

2009-12-15 Thread Donn
On Tuesday 15 December 2009 11:12:21 Martijn Arts wrote: > You could do some really awesome stuff with that! I love the webpage > example where you zoom in on the exclamation mark and there's a new page. > It is very cool, but I would inject a note of caution here: I'd a hate a zui to become a c

Memory consumption of multiprocessing.Pool

2009-12-15 Thread Wolodja Wentland
Hi all, I have a problem with the memory consumption of multiprocessing.Pool()'s worker processes. I have a parent process that has to handle big data structures and would like to use a pool of processes for computations. The problem is, that all worker processes have the same memory requirement

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

2009-12-15 Thread Ben Finney
"Diez B. Roggisch" writes: > Not only exists, he should also use the OS' locking mechanisms. The > file could otherwise be stale. > > We use this: Have you tried collaborating with the ‘lockfile’ library developer to converge these solutions? As I understand it, the ‘lockfile’ library is meant

Re: pyZui - anyone know about this?

2009-12-15 Thread Martijn Arts
You could do some really awesome stuff with that! I love the webpage example where you zoom in on the exclamation mark and there's a new page. Just imagine the possibilities! On Tue, Dec 15, 2009 at 9:28 AM, Donn wrote: > On Tuesday 15 December 2009 04:29:39 David Roberts wrote: > > Yes, the to

multiprocessing module

2009-12-15 Thread makobu
I have a function that makes two subprocess.Popen() calls on a file. I have 8 cores. I need 8 instances of that function running in parallel at any given time till all the files are worked on. Can the multiprocessing module do this? If so, whats the best method? A technical overview of how the mu

Re: a list/re problem

2009-12-15 Thread Neil Cerutti
On 2009-12-11, Grant Edwards wrote: > On 2009-12-11, Neil Cerutti wrote: >> On 2009-12-11, Grant Edwards wrote: >>> [s[1:-1] for s in l if (s[0] == s[-1] == '*')] >> >> That last bit doesn't work right, does it, since an == expression >> evaluates to True or False, no the true or false value its

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

2009-12-15 Thread python
Hi Dan, > Maybe I'm missing something, but the locking mechanism already exists: at some point, your server program has to bind to an IP port to listen for incoming request, and any respectable OS won't let two programs bind to the same port at the same time. So if binding to the input port

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

2009-12-15 Thread python
Alex, > one way is you can create a lock file, then when the program start you check to see if this lock file exists. Makes sense - thanks! Regards, Malcolm -- http://mail.python.org/mailman/listinfo/python-list

Re: dictionary with tuple keys

2009-12-15 Thread John Machin
Ben Finney benfinney.id.au> writes: > In this case, I'll use ‘itertools.groupby’ to make a new sequence of > keys and values, and then extract the keys and values actually wanted. Ah, yes, Zawinski revisited ... itertools.groupby is the new regex :-) > Certainly it might be clearer if written

Re: read text file byte by byte

2009-12-15 Thread daved170
On 13 דצמבר, 22:39, Dennis Lee Bieber wrote: > On Sat, 12 Dec 2009 22:15:50 -0800 (PST), daved170 > declaimed the following in gmane.comp.python.general: > > > Thank you all. > > Dennis I really liked you solution for the issue but I have two > > question about it: > > 1) My origin file is Text f

Re: pyZui - anyone know about this?

2009-12-15 Thread Donn
On Tuesday 15 December 2009 04:29:39 David Roberts wrote: > Yes, the toolkit used is PyQt. \me makes note to start learning PyQt asap. > and employs pyramidal tiling for efficiency \me ... time to hit Wikipedia :) > (I haven't used any Qt/KDE voodoo in this regard). Imho, your code should *becom