Need help dealing with spaces in NT paths.

maytagrepairman at maytagrepairman at
Mon Nov 15 21:42:14 CET 1999

Sorry, I know this has to be a FAQ in another newsgroup somewhere since
this is really a Windows/DOS type question that I would think is really

I'm trying to convert a script I wrote in Tcl to Python.  The Tcl
script is run only on UNIX (85% of my software development experience
is in UNIX BTW).  I'm developing the new script on an NT box and want
the script to work for both NT and UNIX.  I have a need to run various
compiled programs from the script.  In Tcl I simply used exec() to do
this.  The easiest way to do this in Python seems to be os.system().  I
don't know ahead of time where or what these external programs are.  In
fact they are passed in as arguments to the script.  I convert these to
absolute path names so I can run them from any directory I choose.
Unfortunately this doesn't seem to work when the executables have
spaces in the full path name.  This doesn't seem to be a Python problem
since I have the same problem when I type the commands in a DOS window.

Anybody have any advice for getting around this?

Sent via
Before you buy.

More information about the Python-list mailing list