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)
More Related Contents:
- What is wrong with my python code? [duplicate]
- how to count average sentence length (in words) from a text file contains 100 sentences using python [closed]
- What needs to be added
- Python 2.7 IndentationError [closed]
- How to detect key presses?
- Using both Python 2.x and Python 3.x in IPython Notebook
- List vs generator comprehension speed with join function [duplicate]
- Launch a completely independent process
- Why does str(float) return more digits in Python 3 than Python 2?
- Add pygame module in PyCharm IDE
- ReactorNotRestartable error in while loop with scrapy
- How to pass an operator to a python function?
- How to read Unicode input and compare Unicode strings in Python?
- Absolute imports in python not working, relative imports work
- Python datetime.utcnow() returning incorrect datetime
- Cancellable threading.Timer in Python
- Python OrderedDict not keeping element order [duplicate]
- Pip freeze vs. pip list
- pandas: replace string with another string
- Pyodbc – “Data source name not found, and no default driver specified”
- how to merge two data frames based on particular column in pandas python?
- sum each value in a list of tuples
- How do I gzip compress a string in Python?
- How to create a new text file using Python
- How to save python screen output to a text file
- Python: How to resize an image using PIL module
- Python not able to open file with non-english characters in path
- numpy.sum() giving strange results on large arrays
- How to fix TypeError: ‘int’ object is not subscriptable
- ‘is’ operator behaves unexpectedly with floats