Re: Passing functions as parameter (multiprocessing)

2012-11-13 Thread Jean-Michel Pichavant
- Original Message - > Oscar Benjamin wrote: > > > I don't know if this is to do with the way that the code was > > simplified before posting but this subproc function wrapper does > > nothing (even after Peter fixed it below). This code is needlessly > > complicated for what it does. > >

Re: Passing functions as parameter (multiprocessing)

2012-11-13 Thread Peter Otten
Oscar Benjamin wrote: > I don't know if this is to do with the way that the code was > simplified before posting but this subproc function wrapper does > nothing (even after Peter fixed it below). This code is needlessly > complicated for what it does. Jean-Michel's Post had the following comment

Re: Passing functions as parameter (multiprocessing)

2012-11-13 Thread Oscar Benjamin
On 13 November 2012 12:51, Peter Otten <__pete...@web.de> wrote: > Jean-Michel Pichavant wrote: > >> I'm having problems understanding an issue with passing function as >> parameters. > >> Here's a code that triggers the issue: >> >> >> import multiprocessing >> >> def f1(): >> print 'I am f1'

Re: Passing functions as parameter (multiprocessing)

2012-11-13 Thread Peter Otten
Jean-Michel Pichavant wrote: > I'm having problems understanding an issue with passing function as > parameters. > Here's a code that triggers the issue: > > > import multiprocessing > > def f1(): > print 'I am f1' > def f2(foo): > print 'I am f2 %s' % foo > > workers = [ > (

Re: Passing functions as parameter (multiprocessing)

2012-11-13 Thread MRAB
On 2012-11-13 12:19, Jean-Michel Pichavant wrote: Fellows, I'm having problems understanding an issue with passing function as parameters. I'm sending some functions to the multiprocessing module (python 2.5 with the proper backport). I'm iterating on a list of functions, however it seems that

Re: Passing Functions

2011-03-11 Thread John Nagle
On 3/11/2011 5:49 AM, yoro wrote: I've found the error, I had to type in: for node in nodeTable: if node != 0 and Node.visited == False: That's just your first error. (Also, you shouldn't have anything but Node items in nodeTable, so you don't need the "node != 0".) The bigges

Re: Passing Functions

2011-03-11 Thread yoro
On Mar 11, 2:00 am, MRAB wrote: > On 11/03/2011 01:13, yoro wrote: > > > Hi, > > > I am having an issue with passing values from one function to another > > - I am trying to fill a list in one function using the values > > contained in other functions as seen below: > > > infinity = 100 > > in

Re: Passing Functions

2011-03-10 Thread MRAB
On 11/03/2011 01:13, yoro wrote: Hi, I am having an issue with passing values from one function to another - I am trying to fill a list in one function using the values contained in other functions as seen below: infinity = 100 invalid_node = -1 startNode = 0 #Values to assign to each node

Re: Passing Functions

2011-03-10 Thread alex23
On Mar 11, 11:13 am, yoro wrote: > Hi, > > I am having an issue with passing values from one function to another > - I am trying to fill a list in one function using the values > contained in other functions as seen below: > > infinity = 100 > invalid_node = -1 > startNode = 0 > > #Values to a

Re: Passing functions around and executing

2008-05-14 Thread Arnaud Delobelle
alex23 <[EMAIL PROTECTED]> writes: > On May 15, 10:53 am, PatrickMinnesota <[EMAIL PROTECTED]> > wrote: >> I have a bunch of functions. I want to put them in a list. Then I >> want to pass that list into another function which does some setup and >> then loops through the list of passed in funct

Re: Passing functions around and executing

2008-05-14 Thread alex23
On May 15, 10:53 am, PatrickMinnesota <[EMAIL PROTECTED]> wrote: > I have a bunch of functions. I want to put them in a list. Then I > want to pass that list into another function which does some setup and > then loops through the list of passed in functions and executes them. > Some of them need

Re: Passing functions around and executing

2008-05-14 Thread Patrick Mullen
Here's a quick dumb example, hope it helps: def function1(a,b,c): print a,b,c def function2(x): print x def function3(y): print y+3 def executeall(list): print "setting up" for function,args in list: function(*args) #Calls the function passing in the arguments mylist = [[f