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

Dennis E. Hamilton infonuovo at email.com
Mon Mar 27 00:55:36 EST 2000


>>> open('c:/autoexec.bat')
<open file 'c:/autoexec.bat', mode 'r' at 1b38ef0>

Yes.

-----Original Message-----
From: python-list-admin at python.org
[mailto:python-list-admin at python.org]On Behalf Of Grant Edwards
Sent: Sunday, March 26, 2000 19:52
To: python-list at python.org
Subject: Re: Newbie - help in opening and reading a file from >>>


On Sun, 26 Mar 2000 21:17:37 GMT, Jerome Chan <eviltofu at rocketmail.com>
wrote:
>
>> I've just installed 1.5 on my Windows 98Se system
>> I'm trying to execute the following-
>> >>>f=open('C:\Autoexec.bat')
>> and I get a no such directory or file error
>> Is there some parameter or path that I must set?
>>  Would apprecaite any clues...
>
>You must escape the \?

Back in the bad old days, I always used forwards slashes when
programming under DOS for just this reason (it also made them
more portable when moving code between DOS, VMS, and Unix).
Does win32 still accept forwards slashes in pathnames the way
DOS used to?

--
Grant Edwards                   grante             Yow!  My life is a patio
                                  at               of fun!
                               visi.com
--
http://www.python.org/mailman/listinfo/python-list





More information about the Python-list mailing list