Bug in Python class static variable?

2007-07-02 Thread Bruza
I am trying to define a class static variable. But the value of the static variable seems to be only defined inside the file that the class is declared. See the code below. When I run "python w.py", I got: 000===> Hello World 001===> Hello World 002===> Not Initialized 003===> Not

Re: Bug in Python class static variable?

2007-07-02 Thread Bruza
On Jul 2, 3:52 am, Duncan Booth <[EMAIL PROTECTED]> wrote: > Bruza <[EMAIL PROTECTED]> wrote: > > I am trying to define a class static variable. But the value of the > > static variable seems to be only defined inside the file that the > > class is declared. See t

Re: Bug in Python class static variable?

2007-07-03 Thread Bruza
On Jul 2, 1:21 pm, Duncan Booth <[EMAIL PROTECTED]> wrote: > Bruza <[EMAIL PROTECTED]> wrote: > > On Jul 2, 3:52 am, Duncan Booth <[EMAIL PROTECTED]> wrote: > >> Bruza <[EMAIL PROTECTED]> wrote: > >> > I am trying to define a class static varia

MySQL_python install failed on Ubuntu 7.1

2007-12-16 Thread Bruza
s like the installation tried to compile the _mysql extension and failed. Anybody knows a solution to this problem? Thanks, Bruza == running install running bdist_egg running egg_info writing MySQL_python.egg-info/PKG-INFO writing top-level names to MySQL_

Re: MySQL_python install failed on Ubuntu 7.1

2007-12-17 Thread Bruza
On Dec 17, 1:31 pm, Bruno Desthuilliers <[EMAIL PROTECTED]> wrote: > Bruza a écrit : > > > I installed MySQL 5.0.45 onUbuntu7.1and downloadMySQL_pythonfrom > > Sourceforge (http://sourceforge.net/project/showfiles.php? > > group_id=22307). Then I untar th

how can I specify a timeout value to Semaphore.acquire()?

2008-06-27 Thread Bruza
ng on Ubuntu 7.10 and I got an error of: acquire() got an unexpected keyword argument 'timeout' Is there a way to specify a timeout value to Semaphore.acquire(), or I have to implement my own "SuperSemaphore"? Thanks in advance, Bruza -- http://mail.python.org/mailman/listinfo/python-list

implement random selection in Python

2007-11-15 Thread Bruza
I need to implement a "random selection" algorithm which takes a list of [(obj, prob),...] as input. Each of the (obj, prob) represents how likely an object, "obj", should be selected based on its probability of "prob".To simplify the problem, assuming "prob" are integers, and the sum of all "prob"

Re: implement random selection in Python

2007-11-15 Thread Bruza
On Nov 15, 9:32 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > On Nov 15, 10:40�pm, Bruza <[EMAIL PROTECTED]> wrote: > > > > > I need to implement a "random selection" algorithm which takes a list > > of [(obj, prob),...] as input. Eac

Re: implement random selection in Python

2007-11-16 Thread Bruza
On Nov 16, 6:58 am, duncan smith <[EMAIL PROTECTED]> wrote: > Bruza wrote: > > I need to implement a "random selection" algorithm which takes a list > > of [(obj, prob),...] as input. Each of the (obj, prob) represents how > > likely an object, "obj&quo

Re: implement random selection in Python

2007-11-16 Thread Bruza
On Nov 16, 4:47 pm, Bruza <[EMAIL PROTECTED]> wrote: > On Nov 16, 6:58 am, duncan smith <[EMAIL PROTECTED]> > wrote: > > > > > Bruza wrote: > > > I need to implement a "random selection" algorithm which takes a list > > > of [(obj