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

learner404 learner404 at gmail.com
Thu Mar 8 22:00:59 CET 2007


On 3/8/07, Jerry Hill <malaclypse2 at gmail.com> 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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.python.org/pipermail/tutor/attachments/20070308/f82a5397/attachment-0001.htm 


More information about the Tutor mailing list