Answers for "python entry textvariable"

11

tkinter entry

from tkinter import *
root = Tk()
entry = Entry(root)
print(entry.get()) # Would print entry data in CL
Posted by: Guest on March-26-2020
0

text variable tkinter

#set a variable and assign it to data type
v = StringVar()

#put that variable as the textvariable value
e = Entry(master, textvariable=v)

#then pack it
e.pack()

#to asign a value to that variable
v.set("a default value")

#to see the value
s = v.get()
print(s)
Posted by: Guest on August-20-2020

Browse Popular Code Answers by Language