import os
os.path.isfile('test.txt') #如果文件不存在,返回False
os.path.exists(directory) #如果目录不存在,返回False
python判断文件是否存在
最新推荐文章于 2023-07-13 15:33:46 发布
import os
os.path.isfile('test.txt') #如果文件不存在,返回False
os.path.exists(directory) #如果目录不存在,返回False