Kent Johnson wrote: > The \ character is a special 'escape' character that is used to insert > non-printing characters into a string. \t represents a single tab > character, not the two characters \ and t. > > To put an actual backslash into a string, you can either double it: > 'c:\\tmp\\junkpythonfile' > or prefix the string with r to make a 'raw' string, which doesn't have > any special meaning for \: > r'c:\tmp\junkpythonfile'
While I don't use Windows myself, I'm believe that you can also use forward-slashes as the path separator, e.g.: junkfile = open('c:/tmp/junkpythonfile','w') (Pardon me if I'm completely wrong.) -- Todd OpenPGP -> KeyID: 0xBEAF0CE3 | URL: www.pobox.com/~tmz/pgp ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ To grasp the true meaning of socialism, imagine a world where everything is designed by the post office, even the sleaze. -- P.J. O'Rourke
pgpK8dI0nX75c.pgp
Description: PGP signature
_______________________________________________ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor