LoginSignup
1
4

More than 1 year has passed since last update.

python 初めてのGUI サイコロアプリ -tkinter- [初心者向け]

Posted at

サイコロアプリを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()

スクリーンショット 2022-07-03 2.49.24.png

1
4
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
4