System is Windows 8.1 Python 3.5
The entry window appears and text can be typed, but I've been unable to get/use that text.
Have reread most websites and tried seven ways to Sunday, but nothing works.
Below is one attempt :
Above prints in command line
Some sites describe use of StringVar() as below
The entry window appears and text can be typed, but I've been unable to get/use that text.
Have reread most websites and tried seven ways to Sunday, but nothing works.
Below is one attempt :
from tkinter import *
root = Tk()
root.geometry('600x400+80+40')
def getentry() :
ewidget = Entry(root, width = 32)
ewidget.pack()
textstring = ewidget.get()
print("Entered = ",textstring)
def main() :
getentry()
mainloop()
if __name__ == '__main__' :
main() Above prints in command line
Output: >>> Entered = < nothing >Surprisingly this is printed before anything is typed into Entry window.Some sites describe use of StringVar() as below
def getentry() :
estring = StringVar()
ewidget = Entry(root, textstring = estring, width = 32)
ewidget.pack()
print("Entered = ",textstring)This fails also, with Error message :Error:unknown option "-textstring"Any help greatly appreciated.
