dynamic argument name for functions
mark
rkmr.em at gmail.com
Fri Jan 12 15:30:25 EST 2007
More information about the Python-list mailing list
Fri Jan 12 15:30:25 EST 2007
- Previous message (by thread): dynamic argument name for functions
- Next message (by thread): WMI Python, writing remotely and retrieving env variables values
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
On 1/12/07, Carsten Haese <carsten at uniqsys.com> wrote: > > On Fri, 2007-01-12 at 20:22 +0000, Simon Brunning wrote: > > On 1/12/07, mark <rkmr.em at gmail.com> wrote: > > > I want to pass a value to an argument of a function. The argument name > is > > > dynamic and is stored in a > > > variable. How do I call the function using with arg_name and value as > the > > > parameters. > > > thanks > > > arg_name = 'arg1' > > > arg_value = 'i am passing a value to argument 1' > > > function(???????) > > > > Untested: > > > > function(**{arg_name: arg_value}) > > My version is superior: I tested it before replying. ;) both work like charm! ;-)! thanks mark -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mail.python.org/pipermail/python-list/attachments/20070112/78c19121/attachment.html>
- Previous message (by thread): dynamic argument name for functions
- Next message (by thread): WMI Python, writing remotely and retrieving env variables values
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Python-list mailing list