<分区>
Possible Duplicate:
Pythonic way to check if a file exists?
python如何判断一个文件是否存在?
在 Windows 中编写脚本
<分区>
Possible Duplicate:
Pythonic way to check if a file exists?
python如何判断一个文件是否存在?
在 Windows 中编写脚本
最佳答案
这很容易使用 os
模块。
from os.path import exists
print exists("C:\somefile.txt")
关于python - 如何检查python中是否存在文件?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6908003/