サイコロアプリをGUIで作成 -tkinter-
import tkinter
import random
def sai():
la["text"] = random.randint(1,6)
root = tkinter.Tk()
root.geometry("200x200")
root["bg"] = "black"
FNT = ("Times New Roman",100)
la = tkinter.Label(text="1", font=FNT, bg="black", fg="lime")
la.pack()
bu = tkinter.Button(text="サイコロ", command=sai)
bu.pack()
root.mainloop()