Re: [Tutor] White spaces in a path (from a string variable) and os.popen on Windows

2007-03-08 Thread learner404
On 3/8/07, Jerry Hill <[EMAIL PROTECTED]> wrote: > result=os.popen("dir "+dirPath).read() to this: result=os.popen('dir "%s"' % dirPath).read() That worked fine with all the directories I threw at it. Thanks a lot Jerry ! :) I didn't think of doing it this way.

Re: [Tutor] White spaces in a path (from a string variable) and os.popen on Windows

2007-03-08 Thread Jerry Hill
On 3/8/07, learner404 <[EMAIL PROTECTED]> wrote: > When I know exactly the path in advance I use a raw string r' ' and I add > double quotes where necessary to avoid the white spaces syndrome. But I > don't see how to do this "easily" when my path is a string variable given by > my GUI (like C:\Doc

[Tutor] White spaces in a path (from a string variable) and os.popen on Windows

2007-03-08 Thread learner404
Hello, I'm getting crazy with white spaces on Windows. :( I'm aware of the three paths gotchas on Windows well explained here: http://www.freenetpages.co.uk/hp/alan.gauld/tutfiles.htm But my problem is with white spaces in windows paths (very common with "program files", "documents and settings