Created
April 9, 2024 21:51
-
-
Save vigilantPotato/768f7b572f43d24e9f731c025ca3cd8c to your computer and use it in GitHub Desktop.
How to reflect the text in entry widget to label by using variable
This file contains hidden or 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 ctypes | |
| import tkinter | |
| if __name__ == "__main__": | |
| ctypes.windll.shcore.SetProcessDpiAwareness(1) | |
| root = tkinter.Tk() | |
| #variable | |
| var = tkinter.StringVar(root) | |
| #Label | |
| l = tkinter.Label(root, width=15, bg="lightblue", textvariable=var) | |
| l.pack(pady=3) | |
| #Entry | |
| e1 = tkinter.Entry(root, bd=5, textvariable=var) | |
| e1.pack(padx=3) | |
| root.mainloop() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment