Last active
April 18, 2024 19:37
-
-
Save bsesic/507d907d9bfb035754b901b05024b9d9 to your computer and use it in GitHub Desktop.
zip ttl file
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def compress_ttl(file_name): | |
""" | |
Compress the ttl file. | |
returns: compressed ttl file. | |
""" | |
# compress the ttl file | |
try: | |
with open(file_name, 'rb') as f_in: | |
with gzip.open(file_name + '.gz', 'wb') as f_out: | |
shutil.copyfileobj(f_in, f_out) | |
except Exception as e: | |
print("Could not compress file. Error: ", e) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This function zips a turtle file.