import os

def createFolder(directory):
    try:
        if not os.path.exists(directory):
            os.makedirs(directory)
    except OSError:
        print ('Error: Creating directory. ' +  directory)
        

# Example
createFolder('./data/')
# Creates a folder in the current directory called data

 

from https://gist.github.com/keithweaver/562d3caa8650eefe7f84fa074e9ca949

 

相关文章:

  • 2022-12-23
  • 2022-01-05
  • 2022-12-23
  • 2021-12-12
  • 2021-12-24
  • 2021-12-13
  • 2022-01-03
  • 2021-10-10
猜你喜欢
  • 2021-09-29
  • 2022-01-01
  • 2021-11-21
  • 2022-12-23
  • 2021-10-21
  • 2021-10-17
  • 2022-12-23
相关资源
相似解决方案