Last active
July 24, 2021 17:31
-
-
Save SzczurekYT/2bba5d10159a69e9860536658fd4a0fa to your computer and use it in GitHub Desktop.
Python TKInter Problem
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
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() |
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
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