Python/Compression: Difference between revisions
< Python
Jump to navigation
Jump to search
| (One intermediate revision by the same user not shown) | |||
| Line 5: | Line 5: | ||
=== Decompress === | === Decompress === | ||
<source lang="python"> | <source lang="python"> | ||
import lzma | |||
with lzma.open("file.xz") as f: | |||
file_content = f.read() | |||
</source> | </source> | ||
| Line 14: | Line 16: | ||
== Zip (*.zip) == | == Zip (*.zip) == | ||
* See: https://docs.python.org/3/library/zipfile.html | |||
=== Decompress === | === Decompress === | ||
Latest revision as of 03:47, 26 February 2020
LZMA (*.xz)
Decompress
import lzma
with lzma.open("file.xz") as f:
file_content = f.read()
Compress
# TODO
Zip (*.zip)
Decompress
# TODO
Compress
# TODO