On Tue, Nov 1, 2011 at 2:48 PM, Jefferson Ragot <jbr5...@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? >
sys.argv contains exactly what you typed in on the command line. Nothing more, nothing less. It doesn't care whether what you typed is actually a filename or a plain number or some string, it just passes the commands as they are. You can use the os.path.abspath() function on your argument, that will probably do what you want. HTH, Hugo _______________________________________________ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor