Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

python gzip file

import gzip
f_in = open('/home/joe/file.txt')
f_out = gzip.open('/home/joe/file.txt.gz', 'wb')
f_out.writelines(f_in)
f_out.close()
f_in.close()
Comment

python Decompress gzip File

import gzip
import shutil
with gzip.open('file.txt.gz', 'rb') as f_in:
    with open('file.txt', 'wb') as f_out:
        shutil.copyfileobj(f_in, f_out)
Comment

PREVIOUS NEXT
Code Example
Python :: python ftplib get list of directories 
Python :: how to ask a question in python 
Python :: Python NumPy swapaxis Function Syntax 
Python :: install quick-mailer 
Python :: Delete file in python Using the os module 
Python :: python printing variables 
Python :: nn.dropout 
Python :: failed to execute script 
Python :: tkinter get child in frame 
Python :: calculate the same value in list i python 
Python :: pychamrfind and replace 
Python :: how to rotate screen with python 
Python :: plt.tick_params 
Python :: python set timezone of datetime.now 
Python :: std python 
Python :: select rows from a list of indices pandas 
Python :: python pip jupyter notebook install 
Python :: python line_profiler 
Python :: change xlabel rotate in seaborn 
Python :: run streamlit from python 
Python :: xgboosat save_model 
Python :: async sleep python 
Python :: python 3 replace all whitespace characters 
Python :: How to select rows in a DataFrame between two values, in Python Pandas? 
Python :: how to write the character from its ascii value in python 
Python :: python remove first substring from string 
Python :: make white image numpy 
Python :: difference between two dictionaries python 
Python :: python initialize empty dictionary 
Python :: python mixins 
ADD CONTENT
Topic
Content
Source link
Name
3+6 =