Can anyone help me print this simple function to a text box instead of the shell?
Like this?
from tkinter import * root = Tk() root.geometry("800x800") def retrieve_input(): inputValue = textBox.get("1.0","end-1c") if inputValue == "password": print("ok") 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()>>>
Like this?
from tkinter import * root = Tk() root.geometry("800x800") def retrieve_input(): inputValue = textBox.get("1.0","end-1c") if inputValue == "password": print("fff") else: print("got em") 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()