write function tkinter button code example
Example 1: add a button on tkinter
import tkinter
button1 = ttk.Button(self, text="anything", command=random command)
button1.pack()
Example 2: call a function onclick tkinter
def someFunction:
function body
tkWindow = Tk()
button = Button(tkWindow, command=someFunction)