File Handling Problems Python I/O

Alex Martelli aleaxit at yahoo.com
Thu Jan 6 13:46:05 EST 2005


Josh <JoshuaACohen at gmail.com> wrote:
   ...
> He is the function where I am making the call. If I change the open
> statment to another file, say "c:\test.txt", a file I know exists, it

Are you sure a file exist whose name is, c, colon, tab, e, s, t ...?

\t is an escape sequence and it means TAB (character of ascii code 9).

Try 'c:/test.txt' -- using normal slash instead the backslash -- and you
should be fine.

You mention you have some experience with other languages: if those
languages include C, or Java, or C++, and many others besides (all which
use backslashes for escape sequences in strings), you'd have exactly the
same issues.


Alex



More information about the Python-list mailing list