Python/Compression: Difference between revisions

From Fundamental Ramen
Jump to navigation Jump to search
 
(2 intermediate revisions by the same user not shown)
Line 1: Line 1:
== LZMA (*.xz) ==
== LZMA (*.xz) ==
* See: https://docs.python.org/3/library/lzma.html


=== Decompress ===
=== Decompress ===
<source lang="python">
<source lang="python">
# TODO
import lzma
with lzma.open("file.xz") as f:
    file_content = f.read()
</source>
</source>


Line 12: 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