A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://mail.python.org/pipermail/python-list/1999-November/004920.html below:

Need help dealing with spaces in NT paths.

Need help dealing with spaces in NT paths. Need help dealing with spaces in NT paths.piet at cs.uu.nl piet at cs.uu.nl
Wed Nov 17 05:56:21 EST 1999
>>>>> "T. C. Mits" <71351.356 at compuserve.com> (TCM) writes:

TCM> A simple example of the difficulty is:
>>>> os.system(r'"dir Program Files"')
TCM> Bad command or file name
TCM> 0
>>>> 


TCM> This is run at the root of C: for simplicity.


TCM> I also get:

TCM> os.popen(r'"dir Program Files"', "r")
TCM> Bad command or file name
TCM> <open file '"dir program files"', mode 'r'  at 795930>

TCM> What does that mean?

It means there is no program with the name: dir program files
You should use:

os.system(r'dir "Program Files"')
os.popen(r'dir "Program Files"', "r")
-- 
Piet van Oostrum <piet at cs.uu.nl>
URL: http://www.cs.uu.nl/~piet [PGP]
Private email: Piet.van.Oostrum at gironet.nl


More information about the Python-list mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4