(no subject)

Erik Wilsher erik.wilsher at iname.com
Tue May 23 02:49:34 EDT 2000


--- In python-list at egroups.com, "Emile van Sebille" <emile at f...> 
wrote:
> You're probably using a name that wasn't previously
> a file in that directory, so the file is created,
> and therefore empty when you read it.  Try putting
> a text file there, then reading it.

Yes, and in addition try to use "raw" strings or double backslashes 
in the file-name argument of the open call.

 >>>f=open(r'c:\temp\myfile.txt','r')
 >>>f=open('c:\\temp\\myfile.txt','r')

   Erik Wilsher


> ----- Original Message -----
> From: Phoon, David <DPhoon at a...>
> 
>> hi
>>
>>
>> I am trying out the tutorial to file reading and writing and when I
> run
>> python in nt
>> eg >>> f=open('c:\temp\myfile.txt','r')
>> >>> f.read()
>> yields a blank string...""
>>






More information about the Python-list mailing list