1 Star 0 Fork 0

fanyangchu/PythonCode

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
RandomDice.py 518 Bytes
一键复制 编辑 原始数据 按行查看 历史
Utkarsh Mishra 提交于 2020-10-01 08:57 . Added Helpful Comments
# GGearing 01/10/19
# Random Dice Game using Tkinter
#Tkinter is used for Making Using GUI in Python Program!
#randint provides you with a random number within your given range!
from random import randint
from tkinter import *
#Function to rool the dice
def roll():
text.delete(0.0, END)
text.insert(END, str(randint(1, 100)))
#Defining our GUI
window = Tk()
text = Text(window, width=3, height=1)
buttonA = Button(window, text="Press to roll!", command=roll)
text.pack()
buttonA.pack()
#End Of The Program!
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/fanych/pythoncode.git
git@gitee.com:fanych/pythoncode.git
fanych
pythoncode
PythonCode
master

搜索帮助