reloading all modules

2009-03-09 Thread Noam Aigerman
Hi, Is there a way to use the reload() func or something else, to refresh all of the modules you have imported? I don't care whether the module that will run this code will be reloaded or not, so whichever is the easiest... Thanks, Noam -- http://mail.python.org/mailman/listinfo/python-list

RE: Kill a function while it's being executed

2009-02-17 Thread Noam Aigerman
-list@python.org Subject: Re: Kill a function while it's being executed On Wed, 2009-02-04 at 13:40 +0200, Noam Aigerman wrote: Hi All, I have a script in which I receive a list of functions. I iterate over the list and run each function. This functions are created by some other user who

Referencing resources from python

2009-02-16 Thread Noam Aigerman
Hi, What is the best way to reference a non-python file's path from inside python ? Until now, I (stupidly) had such lines as: theFile=open('../somefile.txt') in my python files. Now I moved my python files to another dir, and all those relative filenames broke. On the other hand, the

Propagating function calls

2009-02-10 Thread Noam Aigerman
Suppose I have a python object X, which holds inside it a python object Y. How can I propagate each function call to X so the same function call in Y will be called, i.e: X.doThatFunkyFunk() Would cause Y.doThatFunkyFunk() Thanks, Noam -- http://mail.python.org/mailman/listinfo/python-list

Distributing simple tasks

2009-02-06 Thread Noam Aigerman
Hi, Suppose I have an array of functions which I execute in threads (each thread get a slice of the array, iterates over it and executes each function in it's slice one after the other). Now I want to distribute these tasks between two machines, i.e give each machine half of the slices and let it

RE: Distributing simple tasks

2009-02-06 Thread Noam Aigerman
] Sent: Friday, February 06, 2009 4:01 PM To: Noam Aigerman; python-list@python.org Subject: RE: Distributing simple tasks Hi, Suppose I have an array of functions which I execute in threads (each thread get a slice of the array, iterates over it and executes each function in it's slice one

Kill a function while it's being executed

2009-02-04 Thread Noam Aigerman
Hi All, I have a script in which I receive a list of functions. I iterate over the list and run each function. This functions are created by some other user who is using the lib I wrote. Now, there are some cases in which the function I receive will never finish (stuck in infinite loop). Suppose I

RE: Kill a function while it's being executed

2009-02-04 Thread Noam Aigerman
@python.org] On Behalf Of Albert Hopkins Sent: Wednesday, February 04, 2009 5:26 PM To: python-list@python.org Subject: Re: Kill a function while it's being executed On Wed, 2009-02-04 at 13:40 +0200, Noam Aigerman wrote: Hi All, I have a script in which I receive a list of functions. I

A replacement to closures in python?

2009-01-30 Thread Noam Aigerman
Hi, I want to create an array of functions, each doing the same thing with a change to the parameters it uses... something like: arr=['john','terry','graham'] funcs=[] for name in arr: def func(): print 'hello, my name is '+name