Opening File Object

MRAB python at mrabarnett.plus.com
Mon Dec 21 12:13:13 EST 2009


Ray Holt wrote:
> I use the following code:
> fileobject = open("e:\\Ray Holts Documents\\Word Documents\\1850 Warren 
> MS Jenkins", 'y')
> line = fileobject.readline()
>  
> I get the following error message:Traceback (most recent call last):
>   File "C:/Python26/Reading_and_Writing_Files", line 5, in <module>
>     fileobject = open("E:\\Ray Holts Documents\Word Documents\\1850 
> Warren MS Jenkins", 'r')
> IOError: [Errno 2] No such file or directory: 'E:\\Ray Holts 
> Documents\\Word Documents\\1850 Warren MS Jenkins'
> I know the file exists because I opened it in MS Word. Can someone help 
> me?
> 
Look for the file using Windows Explorer. I expect that the filename has
an extension, which you're omitting.



More information about the Python-list mailing list