hi , I am writing a scriot which will move old files from one directory to backup The files are in mode *20090307* mean *yyyymmmdd* to new files. The script is below is like this
*import os import datetime import time from datetime import date today=date.today()* *for x in range(5,10): interval=datetime.timedelta(x) print interval today=today-interval today=today.strftime("%Y%m%d") print today src=r"f:\Sql_Loader\SMR\file_log_backup\smr"+today+"*" dest=r" f:\Sql_Loader\SMR\file_log_backup2" print src print dest os.system(r"move " +src+" "+ dest)* but the error is like that *Traceback (most recent call last): File "remove_old_files.py", line 10, in <module> today=today-interval TypeError: unsupported operand type(s) for -: 'str' and 'datetime.timedelta' * It seems datetime.timedelta()does not respond with my loop Any help??
-- http://mail.python.org/mailman/listinfo/python-list