os.spawnl problem under windows...

Alex Martelli aleax at aleax.it
Sun May 12 10:33:25 EDT 2002


Max wrote:
        ...
>>>>os.spawnl(os.P_WAIT, 'c:\windows\notepad.exe', 'c:\windows\notepad.exe')

As these are plain strings, each \n means a single newline characters.

Double up every backslash or use raw string literals 
r'c:\windows\notepad.exe' in which backslash-escapes aren't expanded.

In most cases you can also use normal / slashes instead of back \ ones,
but I don't recall if os.spawnl is among those 'most cases'.


Alex




More information about the Python-list mailing list