Re: open filename with spaces in path

2008-05-07 Thread Chris
On May 7, 3:25 pm, "A.T.Hofkamp" <[EMAIL PROTECTED]> wrote: > On 2008-05-07, Chris <[EMAIL PROTECTED]> wrote: > > os.chdir('C:\temp\my test') > > Traceback (most recent call last): > >   File "", line 1, in > > WindowsError: [Error 123] The filename, directory name, or volume > > label syntax

Re: open filename with spaces in path

2008-05-07 Thread A.T.Hofkamp
On 2008-05-07, Chris <[EMAIL PROTECTED]> wrote: os.chdir('C:\temp\my test') > Traceback (most recent call last): > File "", line 1, in > WindowsError: [Error 123] The filename, directory name, or volume > label syntax is incorrect: 'C:\temp\\my test' Python strings have \ escapes, such as

Re: open filename with spaces in path

2008-05-07 Thread Chris
On May 7, 1:09 am, "Kam-Hung Soh" <[EMAIL PROTECTED]> wrote: > On Wed, 07 May 2008 08:36:35 +1000, Michael Robertson   > > <[EMAIL PROTECTED]> 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

Re: open filename with spaces in path

2008-05-06 Thread Kam-Hung Soh
On Wed, 07 May 2008 09:09:08 +1000, Kam-Hung Soh <[EMAIL PROTECTED]> wrote: On Wed, 07 May 2008 08:36:35 +1000, Michael Robertson <[EMAIL PROTECTED]> 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

Re: open filename with spaces in path

2008-05-06 Thread Kam-Hung Soh
On Wed, 07 May 2008 08:36:35 +1000, Michael Robertson <[EMAIL PROTECTED]> 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 >>> open('./my\\ test/test.txt') Exce

Re: open filename with spaces in path

2008-05-06 Thread Gary Herron
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 w

Re: open filename with spaces in path

2008-05-06 Thread Micah Elliott
On 2008-05-06 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 That's funny. These exact steps work fine for me on Linux, with Pyt

Re: open filename with spaces in path

2008-05-06 Thread Christian Heimes
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') Christian -- http://mail.python.or