py当前目录下创建时间目录
import datetime
import os
# 当前时间
nowTime = datetime.datetime.now().strftime('%Y-%m-%d-%H-%M-%S')
# 当前时间目录路径
pathStr = os.path.abspath('.') + "/" + nowTime
# 是否存在
isExists = os.path.exists(pathStr)
# 不存在则创建
if not isExists:
os.makedirs(pathStr)

浙公网安备 33010602011771号