如何使用Python检查一个文件是否存在?
import os.path os.path.exists(file_path)
os.path.exists(file_path) 返回True即表示文件或者目录是否存在
os.path.isfile(file_path)
os.path.isfile(file_path) 返回True即表示文件是否存在
检查文件是否存在,不包括目录