python call external program (WHAT THE?!)

Gordon McMillan gmcm at hypernet.com
Thu Sep 16 13:38:04 EDT 1999


Jeff wrote:

> if you are trying to write portable code, I would go with the
> suggestion below of using forward slashes in path names... if it
> doesn't work by default under windows, you can write yourself a
> simple function that *can* do it for you, and filter all your
> pathnames through it-- the '/' is more natural anyway. have a
> look at the 'os.path' module
> <URL:http://www.python.org/doc/current/lib/module-os.path.html>.

Forward slashes work fine on Windows when the run through 
the C library. When passed to os.system, however, they fail 
messily, because that goes nowhere near the C library, and 
the Windows API breaks up the string at each slash, thinking 
they are options.

- Gordon




More information about the Python-list mailing list