From abdb09dca75a86f8ddac8b6f143f1ceb5efb733f Mon Sep 17 00:00:00 2001 From: pythonboi Date: Tue, 27 Sep 2022 11:21:45 -0400 Subject: [PATCH] adding new code on compressing a file --- DjangoWeb/crm/crm/FileCompress.py | 0 FileCompress.py | 6 ++++++ 2 files changed, 6 insertions(+) create mode 100644 DjangoWeb/crm/crm/FileCompress.py create mode 100644 FileCompress.py diff --git a/DjangoWeb/crm/crm/FileCompress.py b/DjangoWeb/crm/crm/FileCompress.py new file mode 100644 index 0000000..e69de29 diff --git a/FileCompress.py b/FileCompress.py new file mode 100644 index 0000000..fa2a1ee --- /dev/null +++ b/FileCompress.py @@ -0,0 +1,6 @@ +import gzip +import shutil + +with open(r'C:\Users\htukuru\Downloads\efw-1390300394-firewall-20220926.log', 'rb') as file_in: + with gzip.open(r'C:\Users\htukuru\Downloads\efw-1390300394-firewall-20220926.log.gz', 'wb') as file_out: + shutil.copyfileobj(file_in, file_out)