Commit 4654b8f4 authored by hujun's avatar hujun

is dir

parent cd9b7f7f
...@@ -234,7 +234,10 @@ class DownFile: ...@@ -234,7 +234,10 @@ class DownFile:
time_str = time.strftime("%Y-%m-%d %H:%M:%S", time.localtime()) time_str = time.strftime("%Y-%m-%d %H:%M:%S", time.localtime())
insert_string = "[{time}] {a} {b} {c}".format(time=time_str, a=title, b=content, c='\n') insert_string = "[{time}] {a} {b} {c}".format(time=time_str, a=title, b=content, c='\n')
date = time.strftime("%Y-%m-%d", time.localtime()) date = time.strftime("%Y-%m-%d", time.localtime())
file_url = "./log_" + date + ".log" file_url = "./log/"
if not os.path.exists(file_url):
os.mkdir(file_url)
file_url += date + ".log"
f = open(file_url, 'a') f = open(file_url, 'a')
f.write(insert_string) f.write(insert_string)
f.close() f.close()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment