[Tutor] sys.argv

Andre Roberge andre.roberge at gmail.com
Mon Feb 13 16:02:39 CET 2006


On 2/13/06, János Juhász <janos.juhasz at velux.com> wrote:
> Hi,
>
> I want to pass args to my python script on XP.
> This code
> print 'argv[0] %s' % sys.argv[0]
> print 'argv[1] %s' % sys.argv[1]
> print 'argv[2] %s' % sys.argv[2]
>
> shows this:
> argv[0] D:\devel\home\devel\python\db\xlsxml.py
> argv[1] "K:\IT\admin\test\Flat
> argv[2] Files\2006\06.02.2006-293753-gy"

Your path has a space in it (between Flat and Files). This is probably why it is
broken as two different arguments.
André


>
> but I would see this:
> argv[0] D:\devel\home\devel\python\db\xlsxml.py
> argv[1] "K:\IT\admin\test\Flat Files\2006\06.02.2006-293753-gy"
> argv[2] ''
>
>
> Yours sincerely,
> ______________________________
> János Juhász
>
> _______________________________________________
> Tutor maillist  -  Tutor at python.org
> http://mail.python.org/mailman/listinfo/tutor
>


More information about the Tutor mailing list