ZykBee
Newbie
- Oct 30, 2017
- 4
- 0
Can anyone possibly show me how to switch this exact code to print to a textbox instead of to the shell?<<<
from tkinter import *
root = Tk()
root.geometry("500x500")
def retrieve_input():
inputValue = textBox.get("1.0","end-1c")
if inputValue == "test":
print("yes")
else:
print("no")
textBox=Text(root, height=20, width=30)
textBox.pack()
buttonCommit = Button(root, height=1, width=10, text="Commit",
command=lambda:retrieve_input())
buttonCommit.pack()
mainloop()
>>>
from tkinter import *
root = Tk()
root.geometry("500x500")
def retrieve_input():
inputValue = textBox.get("1.0","end-1c")
if inputValue == "test":
print("yes")
else:
print("no")
textBox=Text(root, height=20, width=30)
textBox.pack()
buttonCommit = Button(root, height=1, width=10, text="Commit",
command=lambda:retrieve_input())
buttonCommit.pack()
mainloop()
>>>