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

来源:互联网 发布:斐波那契数列 python 编辑:程序博客网 时间:2024/04/26 12:28
>>> 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

0 0
原创粉丝点击