Michael Robertson wrote:
I'm having trouble opening a file in linux, whose path has spaces in it.

$ mkdir my\ test
$ echo test > my\ test/test.txt
$ python

>>> open('./my test/test.txt')
Exception

This works just fine for me.  No need to escape the spaces.

You haven't given us much to work with -- tell us what exception you get. (Or just look at it carefully yourself.) Whatever the problem is, I don't believe it has anything to do with the spaces.

Gary Herron



>>> open('./my\\ test/test.txt')
Exception

but yet...

>>> import os
>>> os.chdir('./my test')
>>> open('./test')

works just fine.
--
http://mail.python.org/mailman/listinfo/python-list

--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to