感谢所有帮助回答我最后一个问题的人:
我的朋友拿到了代码,并试图使用 Tkinter 制作一个我们可以用来让事情看起来更漂亮的盒子,但他无法将最后一个问题中的骰子滚轮和 Tkinter 集成在一起。将掷骰子放入下面的代码中的任何帮助或想法都会很棒!
from Tkinter import *
def callme():
label3 = Label(root, text = 'Haha! I lied!')
label3.pack(padx = 10, pady = 10)
root = Tk()
label = Label(root, text = 'How many dice do you want to roll?')
label.pack(padx = 10, pady = 10)
entry = Entry(root,bg = 'white').pack(padx = 10, pady = 10)
label2 = Label(root, text = 'How many dice do you want to roll?')
label2.pack(padx = 10, pady = 10)
entry = Entry(root,bg = 'white').pack(padx = 10, pady = 10)
frame = Frame(root, bg = 'yellow')
button = Button(frame, command = callme, text = 'Roll!',width = 5, height = 2)
frame.pack()
button.pack(padx=10,pady=10)
root.mainloop()