Skip to content

Instantly share code, notes, and snippets.

@SzczurekYT
Last active July 24, 2021 17:31
Show Gist options
  • Save SzczurekYT/2bba5d10159a69e9860536658fd4a0fa to your computer and use it in GitHub Desktop.
Save SzczurekYT/2bba5d10159a69e9860536658fd4a0fa to your computer and use it in GitHub Desktop.
Python TKInter Problem
import tkinter as tk
import secondFile as f2
bool = False
# This isn't executed.
if bool:
print("Secon Window")
f2.showUp()
root = tk.Tk()
label = tk.Label(text="Hello! I'm first window!", font=("SEGOEUIL", "20", "bold"))
label.pack()
# But this casues window from secondFile.py to open, instead of only opening window from this file
root.mainloop()
import tkinter as tk
win = tk.Tk()
label = tk.Label(
master=win, text="Hello! I'm second window!", font=("SEGOEUIL", "20", "bold")
)
label.pack()
def showUp():
print("Welcome!")
win.mainloop()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment