**argv can't work

Parthan SR python.technofreak at gmail.com
Fri Jan 19 22:44:07 EST 2007


On 1/20/07, Jm lists <practicalperl at gmail.com> wrote:
>
> hello members,
>
> See my script piece below:
>
> def testB(shift,**argv):
>     print "first argument is %s" %shift
>     print "all other arguments are:",argv
>
> testB('mails','Jen','Jen at att.com','Joe','Joe at aol.com')
>
> It can't work at all.please help tell me the reasons.thanks.
>
>
It works for me, check this one :

>>> def argtst(x, **y):
...     print "first arument is %s" % x
...     print "other arguments are", y
...
>>> argtst(x=10,a=1,b=2,c=3)
first arument is 10
other arguments are {'a': 1, 'c': 3, 'b': 2}


(!) : Do not use the name 'argv' for the second argument.

-- 
With Regards,

TechnoFreak
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20070120/35a8afb3/attachment.html>


More information about the Python-list mailing list