重複の可能性:
ファイルが存在するかどうかを確認するPythonの方法は?
Python 2.6でファイルが存在するかどうかを確認するにはどうすればよいですか?
ファイルが存在する場合は、execredo.pyを実行します。ファイルが存在しない場合execfilestart.py
ファイルは0kbですが、名前はXxx100926.csvです。
アンスは
from os path import exists
from __future__ import with_statement
if exists('Xxx100926.csv'):
from redo import main
#execfile(u'C:\redo.py')
else:
from start import main
#execfile(u'C:\start.py')
with open(Xxx100926.csv, 'a'): pass
#and run main function
main()