Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import gzip
- import bz2
- # Descompresión:
- with gzip.open('fibonaccis-2.tar.gz', 'rt') as f:
- contenido = f.read()
- print (contenido)
- with bz2.open('fibonaccis-2.tar.bz2', 'rt') as f:
- contenido = f.read()
- print(contenido)
- # Compresión:
- with gzip.open('fibonaccis-2.bz', 'wt') as f:
- f.write('Python es amazing!')
- with bz2.open('fibonaccis-2.bz2', 'wt') as f:
- f.write('Python es tremendo!')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement