У меня проблема с python 3.8. Я использую tkinter. Я пытался сделать простой пользовательский интерфейс (я делал некоторые тесты, на самом деле я изучаю tkinter) вот код:
### importing libraries ###
import tkinter
from tkinter import *
from tkinter import *
import os,glob
### importing libraries ###
### creating tk and the principal frame ###
tk = Tk()
tk.title("calculator")
f1 = Frame(tk,bg="white",height=1200, width=1200)
f1.pack()
#### creating tk and the principal frame ####
#### initializing the ui ####
f1.mainloop()
#### initializing the ui####
### creating buttons ###
bruh = tkinter.Button(f1,background="white", text="moltiplica")
### creating buttons ###
### adding buttons and setting the position ###
bruh.pack(padx=30,pady=1)
### adding buttons and setting the position ###
проблема в том, что кнопка не появляется, и когда я закрываю Приложение консоль распечатывает эту вещь: Файл "c: / Users / MS / ### importazione delle librer ie ###. py", строка 21, в bruh = tkinter.Button (f1, background = " white ", command =" ciao ", text =" moltiplica ") Файл" C: \ Users \ MS \ AppData \ Local \ Programs \ Python \ Python38 \ lib \ tkinter__init __. py ", строка 2645, в init_ Widget .__ init (self, master, 'button', cnf, kw) Файл "C: \ Users \ MS \ AppData \ Local \ Programs \ Python \ Python38 \ lib \ tkinter__init __. py", строка 2567 , в __init__self.tk.call (_tkinter.TclError: не может вызвать команду «кнопка»: приложение было уничтожено