How to ZIP an Excel file using python?
Question: How can I zip a excel file using python ? I have a excel sheet. I want to
change ZIP the excel Sheet Using Python. So that It can have less network
usages when I try to download from mine Site. Just Another Requirements.

Thanks in Advance.  
Please Help


Answer: Python's built in zipfile library can be used to compress any file. Below code
should work for you.

    
    
    #!/usr/bin/env python3
    
    import zipfile
    
    zip_file = zipfile.ZipFile('file_name.zip', 'w')
    zip_file.write('/tmp/hello.txt')
    zip_file.close()
    

