1.os.path.exists()
既可以判断文件是否存在,又可以判断文件夹是否存在

2.os.path.isfile()
判断文件是否存在

3.os.path.isdir()
判断文件夹是否存在

 

相关文章: