Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
岳巧源
/
europa-erp-python
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
e34c3104
authored
Sep 14, 2024
by
岳巧源
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
add ungz function
parent
026b61e1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
0 deletions
utils/file_handle.py
utils/file_handle.py
View file @
e34c3104
import
gzip
import
zipfile
...
...
@@ -12,3 +13,10 @@ def unzip(zip_path, save_path):
print
(
'the unzipping process is over...'
)
f
.
close
()
def
ungz
(
file_path
:
str
):
"""unzip the file like *.gz """
new_file_name
=
file_path
.
replace
(
".gz"
,
""
)
g_file
=
gzip
.
GzipFile
(
file_path
)
open
(
new_file_name
,
"wb+"
)
.
write
(
g_file
.
read
())
g_file
.
close
()
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment