how i govern way python? os.system fails due spaces path


i have python book needs govern an outmost program, nonetheless reason fails.



if i have following script:



import os;
os.system("c:\\temp\\a b c\\notepad.exe");
raw_input();


then fails following error:




'c:\temp\a' famous an middle outmost command, operable way collection file.




if i evade way quotes:



import os;
os.system('"c:\\temp\\a b c\\notepad.exe"');
raw_input();


then works. however, i supplement parameter, stops operative again:



import os;
os.system('"c:\\temp\\a b c\\notepad.exe" "c:\\test.txt"');
raw_input();


what right proceed govern way wait complete? i need review cost it, visible way does office following only exits, nonetheless i need wait complete.



also note, relocating way non-spaced route an choice either.






this does work either:



import os;
os.system("'c:\\temp\\a b c\\notepad.exe'");
raw_input();


note replaced single/double quotes.



with but parameter notepad here, fails blunder message




the filename, office name, volume tag syntax incorrect.




Comments

Popular posts from this blog

list macos calm editors formula editors

how i practical urls indicate .aspx pages asp.net deployed an iis? (preferably but iis)

jaxb - xjc - reworking generated typesafe enum category members