On Fri, May 1, 2015 at 8:03 AM, Albert-Jan Roskam <fo...@yahoo.com> wrote:
> I used a str for cmd because I found it more readable that way. I could do 
> cmd.split().

Don't use cmd.split(). That just splits on whitespace without
respecting how the shell tokenizes the command. Use shlex.split(cmd)
instead.

> So os.getcwd() == os.path.dirname(os.path.abspath(__file__)) here?

No, a Python script could be started from any directory, while the RHS
there is specifically the directory of the script. In terms of a
crusty old cmd script we're talking about the difference between %cd%
and %~dp0 (where d=drive and p=path).
_______________________________________________
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor

Reply via email to