Possible Duplicate:
Pythonic way to check if a file exists?
如何使用Python2.6检查文件是否存在?
如果文件存在,请运行exec redo.py。 如果文件不存在exec file start.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()
您可以将main函数放在
redo.py
和start.py
中,然后相关问题 更多 >
编程相关推荐