simple question on optional parameters
Fredrik Lundh
fredrik at pythonware.com
Mon Dec 12 14:28:12 EST 2005
More information about the Python-list mailing list
Mon Dec 12 14:28:12 EST 2005
- Previous message (by thread): Newbie - BigInt
- Next message (by thread): simple question on optional parameters
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
scooterm at hotmail.com wrote: > I am using a toolkit that has a SetFaveNumbers() method. the method > accepts any number of comma-separated numbers. any number of arguments, that is. > the following are all valid examples: > > FooToolkit.SetFaveNumbers(1,3,5) > FooToolkit.SetFaveNumbers(2,4,6,8,10) > FooToolkit.SetFaveNumbers(1) > > I do not know how this method is implemented, but I would like to be > able to call the method using a single variable: > > MyFaveNumbers = [] > MyFaveNumbers.append(2) > MyFaveNumbers.append(4) > > FooToolkit.SetFaveNumbers(MyFaveNumbers) try: FooToolkit.SetFaveNumbers(*MyFaveNumbers) </F>
- Previous message (by thread): Newbie - BigInt
- Next message (by thread): simple question on optional parameters
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Python-list mailing list