Created
October 23, 2016 12:16
-
-
Save fcaylus/9a5ca5aa974cef47f62b2a3f2f036f5b to your computer and use it in GitHub Desktop.
This file contains 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
# -*- coding: utf-8 -*- | |
import tkinter as tk | |
import threading | |
class App(threading.Thread): | |
def __init__(self): | |
threading.Thread.__init__(self) | |
self.start() | |
def requestQuit(self): | |
self.root.quit() | |
def run(self): | |
self.root = tk.Tk() | |
self.root.protocol("WM_DELETE_WINDOW", self.requestQuit) | |
label = tk.Label(self.root, text="Hello World") | |
label.pack() | |
self.root.mainloop() | |
app = App() | |
print('Now we can continue running code while mainloop runs!') | |
for i in range(100): | |
print(i) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment