PYTHONL Telegram 4046
🖥 Сжатие файлов в архивы gz с помощью gzip, и shutil

Элементарно, нам понадобятся функции gzip.open и shutil.copyfileobj:

import gzip 
import shutil

def compress_file(input_file, output_file):
with open(input_file, 'rb') as f_in:
with gzip.open(output_file, 'wb') as f_out:
shutil.copyfileobj(f_in, f_out)

compress_file('clcoding.txt', 'clcoding.txt.gz')


@pythonl
Please open Telegram to view this post
VIEW IN TELEGRAM
👍109🔥6



tgoop.com/pythonl/4046
Create:
Last Update:

🖥 Сжатие файлов в архивы gz с помощью gzip, и shutil

Элементарно, нам понадобятся функции gzip.open и shutil.copyfileobj:

import gzip 
import shutil

def compress_file(input_file, output_file):
with open(input_file, 'rb') as f_in:
with gzip.open(output_file, 'wb') as f_out:
shutil.copyfileobj(f_in, f_out)

compress_file('clcoding.txt', 'clcoding.txt.gz')


@pythonl

BY Python/ django




Share with your friend now:
tgoop.com/pythonl/4046

View MORE
Open in Telegram


Telegram News

Date: |

Hui said the messages, which included urging the disruption of airport operations, were attempts to incite followers to make use of poisonous, corrosive or flammable substances to vandalize police vehicles, and also called on others to make weapons to harm police. As of Thursday, the SUCK Channel had 34,146 subscribers, with only one message dated August 28, 2020. It was an announcement stating that police had removed all posts on the channel because its content “contravenes the laws of Hong Kong.” Those being doxxed include outgoing Chief Executive Carrie Lam Cheng Yuet-ngor, Chung and police assistant commissioner Joe Chan Tung, who heads police's cyber security and technology crime bureau. Telegram channels fall into two types: Image: Telegram.
from us


Telegram Python/ django
FROM American