Tkinter: How to run function with value from Entry after pressing Button
import tkinter as tk # --- functions --- def other_function(value): print('Other Function:', value) def on_click(): print('Entry:', entry.get()) other_function( entry.get() ) # --- main --- root = tk.Tk() entry = tk.Entry(root) entry.pack() button = tk.Button(root, text='OK', command=on_click) button.pack() root.mainloop()
If you like it
Buy a Coffee
Buy a Coffee