Re: [Tutor] os.listdir blocks threads?

2005-10-15 Thread Pierre Barbier de Reuille
stuff to keep run() from returning > > _______ > Tutor maillist - Tutor@python.org > http://mail.python.org/mailman/listinfo/tutor > -- Pierre Barbier de Reuille INRA - UMR Cirad/Inra/Cnrs/Univ.MontpellierII AMAP Botanique et Bio-inf

Re: [Tutor] Importing Modules Within Classes

2005-10-07 Thread Pierre Barbier de Reuille
n is quite time consuming, adding the module check is not a problem also ! (never import a module in a small function likely to be called in an inner-loop !) Pierre -- Pierre Barbier de Reuille INRA - UMR Cirad/Inra/Cnrs/Univ.MontpellierII AMAP Botanique et Bio-informatique de l'Architectu

Re: [Tutor] stopping threads?

2005-09-28 Thread Pierre Barbier de Reuille
# another minor point: why do I need to sleep here? > self.processEvent() > # what happens here-- does the thread die? > def processEvent(self): > print "yeah-- event detected" > > > > ---- >

Re: [Tutor] Aschenputtel problem - Shorter is not better?

2005-09-16 Thread Pierre Barbier de Reuille
(1) 18.772992, (2) 18.764382, (3) 18.759283 > cinderella4: (1) 1.140375, (2) 1.120827, (3) 1.119281 > cinderella5: (1) 1.460923, (2) 1.444996, (3) 1.444842 > cinderella6: (1) 1.481483, (2) 1.469315, (3) 1.478990 > cinderella7: (1) 7.211108, (2) 7.208998, (3) 7.202029 > > "cind

Re: [Tutor] Aschenputtel problem

2005-09-16 Thread Pierre Barbier de Reuille
t; "Die guten ins Töpfchen, die schlechten ins Kröpfchen." > > (The good ones in the pot, the bad ones in the crop) > > Chris > > > > > > > ____________

Re: [Tutor] Multiple Simultaneous Loops

2005-09-15 Thread Pierre Barbier de Reuille
can zip the L1 and L2 into L > L = zip(L1,L2) # L = [(1,11),(2,22),(3,33)] > then you can process: > for x in L: > dosomething(x[0])... > dosomething(x[1])... > I'm not so sure about your problem but > If you want to do something parallel processing then you should go

Re: [Tutor] [tutor] threading problem in GUI

2005-09-08 Thread Pierre Barbier de Reuille
Like now if you want to log your strings on a file, you just define the function writing in the file and connect the event to this function: you'll have both the GUI and the log-file outputs ! This is, AFAIK, the best existing implementation for user interfaces ! Pierre nephish a écrit : >

Re: [Tutor] [tutor] threading problem in GUI

2005-09-07 Thread Pierre Barbier de Reuille
emitting_object.connect("writing", self.method_handling_to_signal) Well, I used that and it just work ! Using the signal does not solve any threading problem but allow you to separate between the event and the answer to the event, which is a good habit to take ! Pierre -- Pierre Barbier de Reuille I

Re: [Tutor] threading problem in GUI

2005-09-07 Thread Pierre Barbier de Reuille
Ok, comments inside your code ... nephish a écrit : > Pierre Barbier de Reuille wrote: > >> nephish a écrit : >> >> >>> Pierre Barbier de Reuille wrote: >>> >>> [...] >>> ok, i am still having a little problem understanding. >>&

Re: [Tutor] threading problem in GUI

2005-09-06 Thread Pierre Barbier de Reuille
nephish a écrit : > Pierre Barbier de Reuille wrote: > > [...] > ok, i am still having a little problem understanding. > tried it but i don't know if i have things set in the right order. > > > gtk.gdk.threads_init() > # Here initialize what you want

Re: [Tutor] threading problem in GUI

2005-09-06 Thread Pierre Barbier de Reuille
self.Input1Buffer.insert(Input1Iter, > Input1Data) > > f.write(str(Sensor_ID)+'\n'+str(c)+'\n'+str(d)+'\n'+str(Status)+'\n'+x_Now) > > > f.close() > thread.start_

Re: [Tutor] Is there an easy way to combine dictionaries?

2005-09-06 Thread Pierre Barbier de Reuille
anks, > Frank > > > > > > ___ > Tutor maillist - Tutor@python.org > http://mail.python.org/mailman/listinfo/tutor -- P

Re: [Tutor] Generate 8 digit random number

2005-08-26 Thread Pierre Barbier de Reuille
digits. Is there any > way that I can tell him to select always a random number with 8 digits? > > Thanks in advanced > > Alberto > > > _______ > Tutor maillist - Tutor@python.org > http://mail.python.org/mailman/listin

Re: [Tutor] Instance attribute as a parameter's default value

2005-08-26 Thread Pierre Barbier de Reuille
2) Although it is not equivalent ! In the second cases, you have to name the parameter to set it ! But I sometimes find this A Good Thing (tm) when no argument order is better ... Pierre -- Pierre Barbier de Reuille INRA - UMR Cirad/Inra/Cnrs/Univ.MontpellierII AMA

Re: [Tutor] cPickle usage

2005-08-25 Thread Pierre Barbier de Reuille
st > object read as output. > Any ideas how to achieve what this? > > chrs > j. > -- Pierre Barbier de Reuille INRA - UMR Cirad/Inra/Cnrs/Univ.MontpellierII AMAP Botanique et Bio-informatique de l'Architecture des Plantes TA40/PSII, Boulevard de

Re: [Tutor] Source PC MAC address

2005-08-25 Thread Pierre Barbier de Reuille
> > Sujet: > Re: [Tutor] Source PC MAC address > Expéditeur: > Pierre Barbier de Reuille <[EMAIL PROTECTED]> > Date: > Wed, 24 Aug 2005 17:00:46 +0200 > Destinataire: > Python Tutor > > Destinataire: > Python Tutor > > Return-Path: > <[EMAIL PRO

Re: [Tutor] Source PC MAC address

2005-08-24 Thread Pierre Barbier de Reuille
> Tutor maillist - Tutor@python.org > http://mail.python.org/mailman/listinfo/tutor -- Pierre Barbier de Reuille INRA - UMR Cirad/Inra/Cnrs/Univ.MontpellierII AMAP Botanique et Bio-informatique de l'Architecture des Plantes TA40/PSII, Bouleva

Re: [Tutor] Thread deamon

2005-08-22 Thread Pierre Barbier de Reuille
ng Unix's & operator for background running) > > chrs > j. > > > ___ > Tutor maillist - Tutor@python.org > http://mail.python.org/mailman/listinfo/tutor > -- Pierre Barbier de Reuille INRA - UMR Cirad/Inra/Cnrs/Univ.MontpellierII AMAP Botani

Re: [Tutor] String formatting

2005-08-20 Thread Pierre Barbier de Reuille
Kent Johnson a écrit : > Pierre Barbier de Reuille wrote: > [...] > > >>Well, when using the "%" operator on string always put a tuple or a >>dictionnary on the RHS : >> >>print "Connection from %s" % (info,) > > > No, you

Re: [Tutor] String formatting

2005-08-20 Thread Pierre Barbier de Reuille
--- > > ___________ > Tutor maillist - Tutor@python.org > http://mail.python.org/mailman/listinfo/tutor -- Pierre Barbier de Reuille INRA - UMR Cirad/Inra/Cnrs/Univ.MontpellierII AMAP Botan

Re: [Tutor] How do I make Python calculate square roots?

2005-07-04 Thread Pierre Barbier de Reuille
sed to a fractional power > >>>>import cmath >>>>cmath.sqrt(-1) > > 1j > ## > > > Best of wishes! > > ___ > Tutor maillist - Tutor@python.org > http://mail.python.org/mailman/l

Re: [Tutor] Changing what you've already printed

2005-06-22 Thread Pierre Barbier de Reuille
must be possible. (I don't mind making my programs Linux only so > that's not a problem). > > Any clues or pointers to documentation gratefully recieved. > > Thanks > > Ed > ___ > Tutor maillist - Tutor@pyth

Re: [Tutor] help: threading + cron in python?

2005-05-13 Thread Pierre Barbier de Reuille
x27;m afraid I don't really understanding threading enought to make this > work.. > > ___ > Tutor maillist - Tutor@python.org > http://mail.python.org/mailman/listinfo/tutor > -- Pierre Barbier de Reuille INRA - UMR Cirad/Inra/Cn

Re: [Tutor] python's bash wait and ampersand equivalent?

2005-04-26 Thread Pierre Barbier de Reuille
e spawned process' stdout to the spawnee's stdout, etc. - again an extra step. Experienced python programmers, what's the best thing to do here? Thanks a lot! -david ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/li

Re: [Tutor] Multithreading and Daemon Program

2005-04-13 Thread Pierre Barbier de Reuille
//mail.python.org/mailman/listinfo/tutor -- Pierre Barbier de Reuille INRA - UMR Cirad/Inra/Cnrs/Univ.MontpellierII AMAP Botanique et Bio-informatique de l'Architecture des Plantes TA40/PSII, Boulevard de la Lironde 34398 MONTPELLIER CEDEX 5, France tel : (33

Re: [Tutor] one line code

2005-04-05 Thread Pierre Barbier de Reuille
an object (and involves many function calls) and is not a "simple" function call. So there is no need to hardwire that kind of things (even if it _may_ be hardwired to improve efficiency). -- Pierre Barbier de Reuille INRA - UMR Cirad/Inra/Cnrs/Univ.MontpellierII AMAP Botaniq

Re: [Tutor] one line code

2005-04-04 Thread Pierre Barbier de Reuille
;-) Thanks a lot in advance. Cheers Christian ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor -- Pierre Barbier de Reuille INRA - UMR Cirad/Inra/Cnrs/Univ.MontpellierII AMAP Botanique et Bi

Re: [Tutor] [HELP]how to test properties of a file

2005-04-03 Thread Pierre Barbier de Reuille
e or writable, especially, writable? -- Pierre Barbier de Reuille INRA - UMR Cirad/Inra/Cnrs/Univ.MontpellierII AMAP Botanique et Bio-informatique de l'Architecture des Plantes TA40/PSII, Boulevard de la Lironde 34398 MONTPELLIER CEDEX 5, France tel : (33) 4 6

Re: [Tutor] How to get user input as regex

2005-04-02 Thread Pierre Barbier de Reuille
ot;s") for line in open("data//phone.txt"): if digs.search(line): print line Thanks, Dick Moores [EMAIL PROTECTED] ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor -- Pierre Barbier de Reu

Re: [Tutor] A Pythonic LinkedList Implementation

2005-03-28 Thread Pierre Barbier de Reuille
I know what linked lists are and why they would be useful in C++ or C or any other but not python. -- Pierre Barbier de Reuille INRA - UMR Cirad/Inra/Cnrs/Univ.MontpellierII AMAP Botanique et Bio-informatique de l'Architecture des Plantes TA40/PSI

Re: [Tutor] primes

2005-03-18 Thread Pierre Barbier de Reuille
you're looking for. Pierre -- Pierre Barbier de Reuille INRA - UMR Cirad/Inra/Cnrs/Univ.MontpellierII AMAP Botanique et Bio-informatique de l'Architecture des Plantes TA40/PSII, Boulevard de la Lironde 34398 MONTPELLIER CEDEX 5, France tel : (33) 4 67 61 65 77f

Re: [Tutor] Re: How do you share a method (function) among several objects?

2005-02-27 Thread Pierre Barbier de Reuille
7;d put it? In a seperate module, like I currently do, even though it's going to be the only piece of code contained inside that module? Xif Pierre Barbier de Reuille wrote: Well, for me, the more logical answer is : multi-inheritance ! If part of your class is the same, (same semantic, same

Re: [Tutor] Re: How do you share a method (function) among several objects?

2005-02-27 Thread Pierre Barbier de Reuille
s() function. So my question is, where is the best way to put it so instances of both classes can use it? Xif ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor -- Pierre Barbier de Reuille INRA - UMR Cirad/Inra/Cnrs/Uni

Re: [Tutor] Time Controlled Execution

2005-02-21 Thread Pierre Barbier de Reuille
rk (as i want it to work in windows & unix). -Varun ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor -- Pierre Barbier de Reuille INRA - UMR Cirad/Inra/Cnrs/Univ.MontpellierII AMAP Botanique et Bio-informatique

Re: [Tutor] Trivia program.

2005-02-16 Thread Pierre Barbier de Reuille
MSN Messenger! MSN Messenger <http://g.msn.com/8HMBEN/2728??PS=47575> Download today it's FREE! _______________ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor -- Pierre Barbier de Reuille INRA - UMR Cirad/Inra/Cnrs/Univ.MontpellierII AMAP Botanique et Bio-informati

Re: [Tutor] Re: print out lines that start with a word

2005-02-09 Thread Pierre Barbier de Reuille
n, it will very probably be more efficient. And the methods (or functions) like "startwith" are avalaible in almost every string library ! Pierre -- Pierre Barbier de Reuille INRA - UMR Cirad/Inra/Cnrs/Univ.MontpellierII AMAP Botanique et Bio-informatique de l'Architecture des Plan

Re: [Tutor] Match on current line and next line. Possible?

2005-02-08 Thread Pierre Barbier de Reuille
_one and nextline == match_two: do_something() Maybe this just isn't possible, since we are working line by line. Any suggestions? Tom ___________ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor --

Re: [Tutor] Hex to Str - still an open issue

2005-02-08 Thread Pierre Barbier de Reuille
___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor _______________ Tutor maillist - Tutor@python.org http://ma

Re: [Tutor] where do we use acquisition ?

2005-02-07 Thread Pierre Barbier de Reuille
we. http://promotions.yahoo.com/new_mail ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor -- Pierre Barbier de Reuille INRA - UMR Cirad/Inra/Cnrs/Univ.MontpellierII AMAP Botanique et Bio-informatique de l'Architecture

Re: [Tutor] Hex to Str

2005-02-04 Thread Pierre Barbier de Reuille
http://mail.python.org/mailman/listinfo/tutor -- Pierre Barbier de Reuille INRA - UMR Cirad/Inra/Cnrs/Univ.MontpellierII AMAP Botanique et Bio-informatique de l'Architecture des Plantes TA40/PSII, Boulevard de la Lironde 34398 MONTPELLIER CEDEX 5, France tel : (33

Re: [Tutor] This Deletes All my Files

2005-02-04 Thread Pierre Barbier de Reuille
mail.yahoo.com _______________ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor -- Pierre Barbier de Reuille INRA - UMR Cirad/Inra/Cnrs/Univ.MontpellierII AMAP Botanique et Bio-informatique de l'Architecture de

Re: [Tutor] i have a question???

2005-02-03 Thread Pierre Barbier de Reuille
: xrange) is exactly what's needed for that problem ! Hint-no-solution: You will need a certain number of intervals, which (the number of intervalls) is plain integer. Then translate from current-intervall-number to pi'ish (sorry for that, my english ;-) value. regards Michael -- Pierr

Re: [Tutor] How to sum rows and columns of a matrix?

2005-02-02 Thread Pierre Barbier de Reuille
ill be a better way to do this...) >>> import numarray >>> m=numarray.array(range(16),shape=(4,4)) >>> numarray.add.reduce(m) array([24, 28, 32, 36]) >>> numarray.add.reduce(m, axis=1) array([ 6, 22, 38, 54]) Kent -- Pierre Barbier de Reuille INRA - UMR C

Re: [Tutor] class instance with identity crisis

2005-01-12 Thread Pierre Barbier de Reuille
ne could reassign weapon to a Prune outside the class definition, but I was hoping to write something in which, given certain circustances arising, the instance would change itself into something else. Time to go back to school! _______________ Tutor maillist - Tut

Re: [Tutor] Hi. Is there another mailing list like this one?

2005-01-10 Thread Pierre Barbier de Reuille
http://mail.python.org/mailman/listinfo/tutor -- Pierre Barbier de Reuille INRA - UMR Cirad/Inra/Cnrs/Univ.MontpellierII AMAP Botanique et Bio-informatique de l'Architecture des Plantes TA40/PSII, Boulevard de la Lironde 34398 MONTPELLIER CEDEX 5, France tel : (33) 4 67 61

Re: [Tutor] leastsquares.py

2004-12-30 Thread Pierre Barbier de Reuille
n G. ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor -- Pierre Barbier de Reuille INRA - UMR Cirad/Inra/Cnrs/Univ.MontpellierII AMAP Botanique et Bio-informatique de l'Architecture des Plantes TA40/PSII, Boulevard de la Lironde 34398 MONTPELLIER CEDEX 5, France tel

Re: [Tutor] How to get the 2 complex cube roots of 1?

2004-12-09 Thread Pierre Barbier de Reuille
796196859-1.1766579932626087e-009j) Thanks, Dick Moores [EMAIL PROTECTED] ___ Tutor maillist - [EMAIL PROTECTED] http://mail.python.org/mailman/listinfo/tutor -- Pierre Barbier de Reuille INRA - UMR Cirad/Inra/Cnrs/Univ.MontpellierII AMAP Botanique