Re: [Tutor] How to pass varying number of arguments to functions called by a dictionary?

2015-02-11 Thread boB Stepp
On Wed, Feb 11, 2015 at 10:58 AM, Dave Angel wrote: > On 02/11/2015 10:29 AM, boB Stepp wrote: >> >> On Wed, Feb 11, 2015 at 8:45 AM, Dave Angel wrote: >>> >>> On 02/11/2015 08:27 AM, boB Stepp wrote: [...] >>> In each case, there are probably better ways... >> >> >> I am open to suggestions! >

Re: [Tutor] How to pass varying number of arguments to functions called by a dictionary?

2015-02-11 Thread Dave Angel
On 02/11/2015 10:29 AM, boB Stepp wrote: On Wed, Feb 11, 2015 at 8:45 AM, Dave Angel wrote: On 02/11/2015 08:27 AM, boB Stepp wrote: [...] Sure, it's viable, but the best approach depends on your goal (use case), and your restrictions. Are these functions really totally unrelated to each ot

Re: [Tutor] How to pass varying number of arguments to functions called by a dictionary?

2015-02-11 Thread boB Stepp
On Wed, Feb 11, 2015 at 8:45 AM, Dave Angel wrote: > On 02/11/2015 08:27 AM, boB Stepp wrote: [...] > > Sure, it's viable, but the best approach depends on your goal (use case), > and your restrictions. Are these functions really totally unrelated to each > other? You not only don't have the sam

Re: [Tutor] How to pass varying number of arguments to functions called by a dictionary?

2015-02-11 Thread boB Stepp
On Wed, Feb 11, 2015 at 8:44 AM, eryksun wrote: > On Wed, Feb 11, 2015 at 7:27 AM, boB Stepp wrote: >> >> pass_args = {'a': (x1, x2, x3), 'b': (y1, y2), 'c': (z)} >> call_fcn[key_letter](key_letter) >> >> But ran into the syntax error that I was giving one argument when >> (possibly) multiple arg

Re: [Tutor] How to pass varying number of arguments to functions called by a dictionary?

2015-02-11 Thread Dave Angel
On 02/11/2015 08:27 AM, boB Stepp wrote: Python 2.4.4, Solaris 10 I have a file of functions. Based on what is read in a data file, different functions in the file of functions will need to be called. I have been trying to make the following approach work, so far unsuccessfully as, in general, e

Re: [Tutor] How to pass varying number of arguments to functions called by a dictionary?

2015-02-11 Thread eryksun
On Wed, Feb 11, 2015 at 7:27 AM, boB Stepp wrote: > > pass_args = {'a': (x1, x2, x3), 'b': (y1, y2), 'c': (z)} > call_fcn[key_letter](key_letter) > > But ran into the syntax error that I was giving one argument when > (possibly) multiple arguments are expected. Do it like this: pass_args = {

Re: [Tutor] How to pass varying number of arguments to functions called by a dictionary?

2015-02-11 Thread Joel Goldstick
On Wed, Feb 11, 2015 at 8:27 AM, boB Stepp wrote: > Python 2.4.4, Solaris 10 > > I have a file of functions. Based on what is read in a data file, > different functions in the file of functions will need to be called. I > have been trying to make the following approach work, so far > unsuccessful

[Tutor] How to pass varying number of arguments to functions called by a dictionary?

2015-02-11 Thread boB Stepp
Python 2.4.4, Solaris 10 I have a file of functions. Based on what is read in a data file, different functions in the file of functions will need to be called. I have been trying to make the following approach work, so far unsuccessfully as, in general, each function may have a different number of