import os
def creat_dir(path):
#判断路径是否存在,返回True,或者False
is_exists = os.path.exists(path)
if is_exists:
print('The path is exist')
else:
os.makedirs(path)
print('Create the dir successfully.')
2023-10-22 21:22:23
import os
def creat_dir(path):
#判断路径是否存在,返回True,或者False
is_exists = os.path.exists(path)
if is_exists:
print('The path is exist')
else:
os.makedirs(path)
print('Create the dir successfully.')