Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/env python
- # -*- coding: utf-8 -*-
- import random
- import tkinter as tk
- def tirar_dado():
- caja.delete(0,tk.END)
- valor = random.randint(1,6)
- caja.insert(0,valor)
- ventana = tk.Tk()
- ventana.title("Dado 2.0")
- ventana.config(width=300, height=300)
- ventana.resizable(0,0)
- boton = tk.Button(text="Arrojar el dado", command=tirar_dado)
- boton.place(x=80, y=30, width=150, height=50)
- etiqueta = tk.Label(text="Valor:")
- etiqueta.place(x=80, y=100)
- caja = tk.Entry()
- caja.place(x=80, y=130, width=150, height=35)
- ventana.mainloop()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement