Commit d9e5c8b9 by 岳巧源

add save path

parent e34c3104
Showing with 2 additions and 2 deletions
...@@ -14,9 +14,9 @@ def unzip(zip_path, save_path): ...@@ -14,9 +14,9 @@ def unzip(zip_path, save_path):
f.close() f.close()
def ungz(file_path: str): def ungz(file_path: str, save_path: str):
"""unzip the file like *.gz """ """unzip the file like *.gz """
new_file_name = file_path.replace(".gz", "") new_file_name = file_path.replace(".gz", "")
g_file = gzip.GzipFile(file_path) g_file = gzip.GzipFile(file_path)
open(new_file_name, "wb+").write(g_file.read()) open(save_path + new_file_name, "wb+").write(g_file.read())
g_file.close() g_file.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 sign in to comment