首页 > 编程语言 > 详细

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

时间:2015-04-29 13:43:21      阅读:148      评论:0      收藏:0      [点我收藏+]
>>> import os
>>> os.path.exists(‘d:/assist‘)
True
>>> os.path.exists(‘d:/assist/getTeacherList.py‘)
True
>>> os.path.isfile(‘d:/assist‘)
False
>>> os.path.isfile(‘d:/assist/getTeacherList.py‘)
True
>>> os.makedirs(‘d:/assist/set‘)
>>> os.path.exists(‘d:/assist/set‘)
True


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

原文:http://my.oschina.net/u/861926/blog/408033

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!