open filename with spaces in path

Christian Heimes lists at cheimes.de
Tue May 6 18:54:25 EDT 2008


Michael Robertson schrieb:
> 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

Works for me

>>> open('./my test/test.txt')
<open file './my test/test.txt', mode 'r' at 0xb7dd6a40>

Christian




More information about the Python-list mailing list