Python_创建时间目录的封装1(os.path&localtime)

创建时间目录的封装1(os.path&localtime)

import os
import os.path
from Util.GetTime import *#同一个包自之间的调用
def make_date_dir(dir_path):
    if os.path.exists(dir_path):
        path = os.path.join(dir_path,get_current_date())
        if not os.path.exists(path):
            os.mkdir(path)

def make_time_dir(dir_path):
 if os.path.exists(dir_path):
    path = os.path.join(dir_path,get_current_time())
    if not os.path.exists(path):
        os.mkdir(path)

if __name__ == "__main__":
    make_time_dir("e:\\testman")
posted @ 2019-12-29 18:57  翻滚的小强  阅读(121)  评论(0)    收藏  举报