Ну вот код для генерации рандомных чисел:
import random
from tkinter import *
def roll():
dice_type = dice_var.get()
if dice_type == 'D4':
result = random.randint(1, 4)
elif dice_type == 'D6':
result = random.randint(1, 6)
elif dice_type == 'D8':
result = random.randint(1, 8)
elif dice_type == 'D10':
result = random.randint(1, 10)
elif dice_type == 'D12':
result = random.randint(1, 12)
elif dice_type == 'D20':
result = random.randint(1, 20)
else: # D100
result = random.randint(1, 100)
result_label.config(text=str(result))
window = Tk()
dice_var = StringVar()
d4_rb = Radiobutton(window, text='D4', variable=dice_var, value='D4')
d4_rb.pack()
d6_rb = Radiobutton(window, text='D6', variable=dice_var, value='D6')
d6_rb.pack()
d8_rb = Radiobutton(window, text='D8', variable=dice_var, value='D8')
d8_rb.pack()
d10_rb = Radiobutton(window, text='D10', variable=dice_var, value='D10')
d10_rb.pack()
d12_rb = Radiobutton(window, text='D12', variable=dice_var, value='D12')
d12_rb.pack()
d20_rb = Radiobutton(window, text='D20', variable=dice_var, value='D20')
d20_rb.pack()
d100_rb = Radiobutton(window, text='D100', variable=dice_var, value='D100')
d100_rb.pack()
roll_button = Button(window, text='Бросить кубик', command=roll)
roll_button.pack()
result_label = Label(window, text='')
result_label.pack()
window.mainloop()