码迷,mamicode.com
首页 > 编程语言 > 详细

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

时间:2015-04-29 13:45:43      阅读:123      评论: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
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!