2014-01-24 41 views
5

我想使用Python 3.3.3來測試備份文件的存在。Python中的文件測試?

事情是這樣的:

if backup does not exist: 
    create it 
    write to backup 

otherwise: 
    run other procedures not related to backup file 

有什麼建議?

+0

請先詢問,此問題已被回答。 – njzk2

+0

重複http://stackoverflow.com/questions/82831/how-do-i-check-if-a-file-exists-using-python?lq=1 – Vader

回答