python 判断文件或文件夹是否存在

版权声明:墨痕诉清风 https://blog.csdn.net/u012206617/article/details/85088550

文件

import os.path 
os.path.exists(file_path)

文件夹

import os.path 
os.path.isdir(tobecheckdir)

猜你喜欢

转载自blog.csdn.net/u012206617/article/details/85088550