Is it possible to determine what a function needs for parameters -

Bruno Desthuilliers bruno.42.desthuilliers at wtf.websiteburo.oops.com
Wed May 2 10:49:17 EDT 2007


rh0dium a écrit :
> Hi all,
> 
> Below is a basic threading program. The basic I idea is that I have a
> function which needs to be run using a queue of data.  Early on I
> specified my function needed to only accept basic parameters ( no
> postional *args or *kwargs ) but now I am re-writing it and I want to
> accept these.  Is there anyway to determine what parameters are needed
> by a given function and format the arguments given appropriately. 

Yes - using inspect.getargspec. I don't have example code at hand yet, 
but it's not really complicated.



More information about the Python-list mailing list