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")

浙公网安备 33010602011771号