how to create multiple windows in tkinter with buttons code example
Example 1: tkinter give button 2 commands
button = Button(root, text="test", command=lambda:[funct1(),funct2()])
Example 2: how to create multiple windows in tkinter with button
import tkinter as tk
def new_window():
window = tk.Toplevel(root)
canvas = tk.Canvas(window, height=HEIGHT, width=WIDTH)
canvas.pack()
HEIGHT = 400
WIDTH = 300
root = tk.Tk()
root.title("new window making machine: ")
canvas = tk.Canvas(root, height=HEIGHT, width=WIDTH)
canvas.pack()
button = tk.Button(root, text="new window", bg='black', fg='#469A00',
command=lambda: new_window())
button.pack()
root.mainloop()
Example 3: multiple functions tkinter
command=lambda:[funcA(), funcB(), funcC()]