[Tutor] Removing files based upon time stamps
Lie Ryan
lie.1296 at gmail.com
Wed Jun 25 23:53:14 CEST 2008
I'm not sure what caused your problem, but...
> os.chdir("c:\BACKUPS\DEV1")
This is a no-no. What if you have a path like this:
'C:\nice\try'
what do you think would python be doing?
It would parse \n as newline and \t as tab
You should do this instead:
r'C:\nice\try'
OR
'C:\\nice\\try'
the first way is called raw string, the backslash lose its meaning
the second way is by escaping the backslash.
More information about the Tutor
mailing list