Re: Variable number of arguments

2018-12-18 Thread dieter
i.e. 3), there are no problems > running the script. > > Currently I have e.g. > ARGV[0] = _Inputfile > ARGV[1] = _Outputfile > ARGV[2] = _Stopwordsfile > > Now I want to allow a variable number of arguments, i.e. 1..n input files or > stopwords lists. > > In this c

RE: Variable number of arguments

2018-12-17 Thread David Raymond
blems running the script. Currently I have e.g. ARGV[0] = _Inputfile ARGV[1] = _Outputfile ARGV[2] = _Stopwordsfile Now I want to allow a variable number of arguments, i.e. 1..n input files or stopwords lists. In this case ARGV[0] would become [filename1.txt, filename2.txt,...], but I wonde

Variable number of arguments

2018-12-17 Thread F Massion
. Currently I have e.g. ARGV[0] = _Inputfile ARGV[1] = _Outputfile ARGV[2] = _Stopwordsfile Now I want to allow a variable number of arguments, i.e. 1..n input files or stopwords lists. In this case ARGV[0] would become [filename1.txt, filename2.txt,...], but I wonder how ARGV[1] would still remain

Re: Passing a variable number of arguments to a function

2009-02-12 Thread Chris Rebert
On Thu, Feb 12, 2009 at 3:44 PM, mercado wrote: > I have the following piece of code that is bugging me: > > #--- > def someFunc(arg1, arg2=True, arg3=0): > print arg1, arg2, arg3 > > someTuple = ( > ("this is a st

Passing a variable number of arguments to a function

2009-02-12 Thread mercado
I have the following piece of code that is bugging me: #--- def someFunc(arg1, arg2=True, arg3=0): print arg1, arg2, arg3 someTuple = ( ("this is a string",), ("this is another string", False), ("this is a

Re: Passing a variable number of arguments to a wrapped function.

2005-08-05 Thread stephen
Using 'plot(*args, **kwargs)' does seem to work just fine. Thanks to all for their suggestions. Stephen -- http://mail.python.org/mailman/listinfo/python-list

Re: Passing a variable number of arguments to a wrapped function.

2005-08-05 Thread Bengt Richter
On 5 Aug 2005 08:34:32 -0700, [EMAIL PROTECTED] wrote: >Is there a better way of doing this so that I don't have to go through >every permutation of possible arguments (the example here from the >matplotlib 'plot' function): > >def makeplot(self, xvalues, yvalues, linecolor='', linewidth=''): >

Re: Passing a variable number of arguments to a wrapped function.

2005-08-05 Thread John Hunter
> "stephen" == stephen <[EMAIL PROTECTED]> writes: stephen> Is there a better way of doing this so that I don't have stephen> to go through every permutation of possible arguments stephen> (the example here from the matplotlib 'plot' function): You can make linecolor=None and lin

Re: Passing a variable number of arguments to a wrapped function.

2005-08-05 Thread en.karpachov
On 5 Aug 2005 08:34:32 -0700 [EMAIL PROTECTED] wrote: > Is there a better way of doing this so that I don't have to go through > every permutation of possible arguments (the example here from the > matplotlib 'plot' function): > > def makeplot(self, xvalues, yvalues, linecolor='', linewidth=''):

Re: Passing a variable number of arguments to a wrapped function.

2005-08-05 Thread Robert Kern
[EMAIL PROTECTED] wrote: > Is there a better way of doing this so that I don't have to go through > every permutation of possible arguments (the example here from the > matplotlib 'plot' function): Usually, you would just make the defaults for linecolor and linewidth the same as the defaults for

Passing a variable number of arguments to a wrapped function.

2005-08-05 Thread stephen
Is there a better way of doing this so that I don't have to go through every permutation of possible arguments (the example here from the matplotlib 'plot' function): def makeplot(self, xvalues, yvalues, linecolor='', linewidth=''): if linecolor and linewidth: plot(xvalues, yvalues, li