[Tutor] A question about sys.argv

Joel Goldstick joel.goldstick at gmail.com
Tue Nov 1 14:55:18 CET 2011


On Tue, Nov 1, 2011 at 9:48 AM, Jefferson Ragot <jbr5393 at gmail.com> wrote:

> In a Vista command prompt if I typed this:
>
>         >>> python  somescript.py  filename
>
> Will sys.argv[1] return a valid path or just the filename?
> If it just returns the filename, is there a simple way to get the path?
>
> --
> Jefferson B. Ragot
>
>
>
> _______________________________________________
> Tutor maillist  -  Tutor at python.org
> To unsubscribe or change subscription options:
> http://mail.python.org/mailman/listinfo/tutor
>
>
sysargv[1] returns the text following your script.

You can find the current working directory with this:

http://docs.python.org/library/os.html#os.getcwd



-- 
Joel Goldstick
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/tutor/attachments/20111101/80c04abc/attachment.html>


More information about the Tutor mailing list