diff options
author | Bryan Bishop <kanzure@gmail.com> | 2013-09-26 01:06:19 -0500 |
---|---|---|
committer | Bryan Bishop <kanzure@gmail.com> | 2013-09-26 01:06:19 -0500 |
commit | 3f28232f0d7ad1a3c6a72c603c5f8318a57fba64 (patch) | |
tree | a5a80332cd32fa42360dc76b7c638328ef14bf97 /pokemontools/map_editor.py | |
parent | e4b2d2e4d24d09b719712bf3793a655307fa60d8 (diff) |
put the tk loop into __main__
Diffstat (limited to 'pokemontools/map_editor.py')
-rw-r--r-- | pokemontools/map_editor.py | 35 |
1 files changed, 20 insertions, 15 deletions
diff --git a/pokemontools/map_editor.py b/pokemontools/map_editor.py index c6f9f16..11bfb4b 100644 --- a/pokemontools/map_editor.py +++ b/pokemontools/map_editor.py @@ -617,18 +617,23 @@ def asm_at_label(asm, label): content += [[l, comment]] return content - -root = Tk() -root.wm_title("MAP EDITOR") -app = Application(master=root) - -try: - app.mainloop() -except KeyboardInterrupt: - pass - -try: - root.destroy() -except TclError: - pass - +def main(): + """ + Launches the map editor. + """ + root = Tk() + root.wm_title("MAP EDITOR") + app = Application(master=root) + + try: + app.mainloop() + except KeyboardInterrupt: + pass + + try: + root.destroy() + except TclError: + pass + +if __name__ == "__main__": + main() |