getting argument names from a function

Oleg Broytmann phd at phd.fep.ru
Tue Jul 10 12:41:49 EDT 2001


On Tue, 10 Jul 2001, dan wrote:
> def aFunction(arg1, arg2):
>    print arg1, arg2
>
> is there a way I can get to the arguments of aFunction (i.e. 'arg1' and
> 'arg2')?

def aFunction(arg1, arg2):
   print vars()

aFunction(1, 2)

Oleg.
----
     Oleg Broytmann            http://phd.pp.ru/            phd at phd.pp.ru
           Programmers don't die, they just GOSUB without RETURN.





More information about the Python-list mailing list