[mod_python] parameters

Joao S. O. Bueno Calligaris gwidion at mpc.com.br
Wed Aug 3 17:02:30 EDT 2005


On Wednesday 03 August 2005 15:09, Khormaee, Cy wrote:
> Hey all,
>
> I was curious if there is a way to create a parameter which will
> accept an arbitrary number of keyword arguments in python.
>
> Currently, im trying to make a procedure to accept output from a
> form which has a variable number of submission fields.  The HTML
> form only outputs keyword arguments (as far as I know) so i cant
> use an arbitary argument list.
>

Hi,
 yes there is.

Just declare your fucntion like this:

def my_function (**args)  :
   
The argument preceeded by two * in the declaration becomes a 
dictionary containing all named parameters passed in.

For unnamed parameters, a single * will receive variable lenght t\uple 
of parameters.

Regards,
	JS
	-><-



> Any help would be greatly appreciated.
>
> _______________________________________________
> Mod_python mailing list
> Mod_python at modpython.org
> http://mailman.modpython.org/mailman/listinfo/mod_python


More information about the Mod_python mailing list