Created
March 10, 2015 22:25
-
-
Save aGupieWare/f08eb02f9d1bade50c0a to your computer and use it in GitHub Desktop.
PyGest Code Snippet 1-5
This file contains hidden or 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
| """ | |
| pygest.py | |
| A simple Python tkinter GUI application for processing file hashes. | |
| blog.agupieware.com | |
| """ | |
| import tkinter | |
| import hashlib | |
| import logging | |
| title = "PyGest" | |
| class View(): | |
| """ | |
| The main view class for the PyGest tkinter interface. | |
| """ | |
| def __init__(self, root_object): | |
| self.root = root_object | |
| def main(): | |
| """ | |
| Main function to run the PyGest GUI application. | |
| """ | |
| logging.basicConfig(format='[%(asctime)s] ln:%(lineno)d %(levelname)s: %(message)s', datefmt='%I:%M:%s', level=logging.DEBUG) | |
| logging.info('{} app started. Logger running.'.format(title)) | |
| # Declare the tkinter Tk() object as root | |
| root = tkinter.Tk() | |
| # Pass in its title | |
| root.title(title) | |
| # Pass the root object to our main View() class | |
| gui = View(root) | |
| # Run the Tk() object's main loop | |
| root.mainloop() | |
| if __name__ == "__main__": | |
| main() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment