Categories
Python

ZIP, Python and TK

The title says it all. Here’s a very simple program written in Python and TK which can extract a ZIP file to the selected location.

Python 3 – Source Codes:

Explanations It creates a TK interface with a button and a text entry widgets. Clicking on the button invokes the work() function. The work() function displays a filedialog and prompts you to choose a ZIP file. Then it creates a new ZipFile object using the file location. The extractall() method of the ZipFile object extracts all contents of the archive into the directory specified using the inputBox text entry widget. We call inputBox.get() to get it’s value. If the value of target location is null, the files are extracted into the current working directory. In case of an invalid target location, it prints out error messages to the console.

It’s a very basic program with a little functionality. It mainly demonstrates the use of TK and Python to write GUI programs that really does something.

One reply on “ZIP, Python and TK”

Hi,
I hope u can help me with an application which i can extract file in mobile phone like “winrar, winzip” so that i can run mig33 multi kick on my nokia n79.

Comments are closed.