Created
March 24, 2020 19:54
-
-
Save cjerrington/4aec633567d4126b879e32092803811d 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
# Simple app start when "password" is correct | |
import tkinter as tk | |
class Application(tk.Frame): | |
def __init__(self, master=None): | |
super().__init__(master) | |
self.master = master | |
self.pack() | |
self.create_widgets() | |
def create_widgets(self): | |
self.hi_there = tk.Button(self) | |
self.hi_there["text"] = "Hello World\n(click me)" | |
self.hi_there["command"] = self.say_hi | |
self.hi_there.pack(side="top") | |
self.quit = tk.Button(self, text="QUIT", fg="red", | |
command=self.master.destroy) | |
self.quit.pack(side="bottom") | |
def say_hi(self): | |
print("hi there, everyone!") | |
val = input("enter name: ") | |
if val == "name": | |
print("true") | |
root = tk.Tk() | |
app = Application(master=root) | |
app.mainloop() | |
else: | |
print("Value does not equal name") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment