调用生成日期格式的目录
# -*- coding: utf-8 -*-
import os
import time
class create_path:
#写在这里是为了直观一点方便修改目录
#windows
path = 'F:\\桌面\\dalu\\'
#linux
#path='/root/dalu/'
def mkdir(self):
files = 'report'+ time.strftime('%Y-%m-%d',time.localtime(time.time()))
path = self.path + files
isExists=os.path.exists(path)
if not isExists:
os.makedirs(path)
print(path + '创建成功')
else:
print(path+' 目录已存在')
return path