Newbie Word & Text file access?

Zachary Bortolot zbortolo at vt.edu
Fri Jul 19 13:36:26 EDT 2002


Hi David,

I had this problem as well when I was first learning Python.  The
solution for me was to replace the backslashes with forward slashes,
so the line would read:

open("C:/DownLoad/test1.txt", "r")

Good luck!

Zack Bortolot


David Wilson <ddw at mcw.net> wrote in message news:<3D381EB2.1030506 at mcw.net>...
> Newbie question after checking about 500 messages on comp.lang.python : 
> Using W2K on Intel, Python 2.2.1, and IDLE 0.8
> 
> Unsuccessful open() of MS Word (.doc) , Abiword (.abw) and text (.txt) 
> files after successfully opening and reading HTML (.html) and LOG files.
> 
> Sample IDLE output:
> 
>  >>> open("C:\DownLoad\test1.txt","r")
> Traceback (most recent call last):
>    File "<pyshell#0>", line 1, in ?
>      open("C:\DownLoad\test1.txt","r")
> IOError: [Errno 2] No such file or directory: 'C:\\DownLoad\test1.txt'
> 
> 
> 1) What else is necessary to open these types of files?
> 
> 2) Please advise where I can find documentation on IDLE and/or Python 
> errors such as "[Errno 2]" above?
> 
> 3) Is there a parser utility which can massage these formatted document 
> files for faster/easier subsequent manipulation?
> 
> Thanks in advance.
> 
> ddw



More information about the Python-list mailing list