python创建目录

 

 

 

 写的不好不要喷!谢谢

import os
def mkdir(create):
    create=create.strip()
    isExists=os.path.exists(create)

    if not  isExists:
        os.mkdir(create)
        return True
    else:
        print("目录已存在!",create)
        return False
print(mkdir("haha/heihei"))

相关文章:

  • 2021-10-31
  • 2021-06-20
  • 2021-06-02
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-05-03
  • 2022-01-10
  • 2021-11-05
  • 2021-09-29
相关资源
相似解决方案