Newbie - help in opening and reading a file from >>>

Jim Nicholson jimn at minusen.force9.co.uk
Mon Mar 27 14:02:59 EST 2000


Dan Howard wrote:
> Hi
> I've just installed 1.5 on my Windows 98Se system
> I'm trying to execute the following-
> >>>f=open('C:\Autoexec.bat')
f=open('C:\\Autoexec.bat')
> and I get a no such directory or file error
python was looking for a file with the BEL character in it '\A' which of
course doesn't exist.  Remember you need to escape your backslashes to
prevent them being interpreted as beginning a character code.

Jim





More information about the Python-list mailing list