用户登录
用户注册

分享至

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

  • 作者: simon笑哈哈
  • 来源: 51数据库
  • 2022-08-12
>>> 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

软件
前端设计
程序设计
Java相关