Python, Automation, Data Science, Artificial Intelligence, Llm.
import lzma # File to compress file_to_compress = 'example.txt' # Compress the file with open(file_to_compress, 'rb') as file_in: with lzma.open(file_to_compress + '.xz', 'wb') as file_out: file_out.write(file_in.read()) print("File compressed successfully.") # Decompress the file with