**argv can't work

Jm lists practicalperl at gmail.com
Fri Jan 19 22:51:45 EST 2007


Thanks for all the kind helps!

2007/1/20, Parthan SR <python.technofreak at gmail.com>:
>
>
> 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
>
>



More information about the Python-list mailing list