import os
filename = r'D:\data\表格\cc.txt'
if os.path.exists(filename):
message = 'OK, the "%s" file exists.'
else:
message = 'Sorry, I cannot find the "%s" file.'
print (message % filename)
import os
filename = r'D:\data\表格\cc.txt'
if os.path.exists(filename):
message = 'OK, the "%s" file exists.'
else:
message = 'Sorry, I cannot find the "%s" file.'
print (message % filename)