python call external program (WHAT THE?!)

Jeff jam at quark.emich.edu
Thu Sep 16 15:34:11 EDT 1999


On Thu, Sep 16, 1999 at 01:38:04PM -0400, Gordon McMillan wrote:
> 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
> 

ok.. then it would seem that in order to present a consistent interface to
the hapless programmer who simply wants his code to work without a lot of
fuss across platforms (unix, jpython, win32), a change ought to be made to
the library such that it tries to interpret things consistently
with the unix version. perhaps a switch that installs
'posix-compatible-behavior' would be the best way to handle it.

thoughts?

regards,
J
-- 
|| visit gfd <http://quark.emich.edu>
|| psa member #293 <http://www.python.org/> 
|| New Image Systems & Services, Inc. <http://www.newimage.com/>




More information about the Python-list mailing list