Return filename
This commit is contained in:
@@ -16,10 +16,11 @@ def extract(url):
|
|||||||
json.dump(html.json(), f, ensure_ascii=False)
|
json.dump(html.json(), f, ensure_ascii=False)
|
||||||
|
|
||||||
|
|
||||||
def save(data, filename, extention):
|
def save(data, filename, extention) -> str:
|
||||||
with open(filename + "_" + (datetime.datetime.now().strftime('%Y-%m-%d %H-%M-%S')) + extention,
|
save_filename = filename + "_" + (datetime.datetime.now().strftime('%Y-%m-%d %H-%M-%S')) + extention
|
||||||
mode='w', encoding='utf-8') as f:
|
with open(save_filename ,mode='w', encoding='utf-8') as f:
|
||||||
f.writelines(data)
|
f.writelines(data)
|
||||||
|
return save_filename
|
||||||
|
|
||||||
|
|
||||||
def checkpath(filepath):
|
def checkpath(filepath):
|
||||||
|
|||||||
Reference in New Issue
Block a user