File Handling Problems Python I/O

Peter Hansen peter at engcorp.com
Thu Jan 6 16:13:28 EST 2005


Josh 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
> will error out stating the file does not exist. Thanks
> 
> def GetStartVars(self):
> try:
> DOWNFILE = open("c:\fixes.txt","r")

Josh, it's surprising that this example worked for you,
given that \f is another string escape (in this case
it's an ASCII FF (formfeed), character code 12, instead
of the TAB (code 8) character that c:\test.txt gives you.

Are you sure this was one of the names that worked?

BTW, the following link in the docs provides a list of
all the recognized escape sequences:

http://www.python.org/doc/current/ref/strings.html

-Peter



More information about the Python-list mailing list