Chris Sprinkles wrote:Also, remember that \ is the escape character for strings in Python. In this particular case it doesn't matter just because you didn't hit any valid escape, but in general, use:>I'm still having trouble with calling a text file and I know its so
simple here is the code
----------------------------------------------------
work = open('C:\Documents and Settings\Administrator\My
Documents\Chris\Python\Python\work.txt', 'r')
"C:\\Documents and Settings\\Adm..."
r"C:\Documents and Settings\Adm..."
In most cases, Windows recognizes forward slashes also: "C:/Documents and Settings/Adm..."
--
Gabriel Genellina