1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 | from Tkinter import * from random import * root = Tk() root.geometry("500x500") root.title("Generador de numeros") def funcion(): num = randint(int(aux.get()),int(aux2.get())) aux3.set(num) et1 = Label(root, text = "Numero 1").place(x=100,y=100) et2 = Label(root, text = "Numero 2").place(x=100,y=150) et3 = Label(root, text = "Numero generado").place(x=100,y=250) arr1=[1,2,3,4,5,6,7,8,9,10] arr2 = [1,2,3,4,5,6,7,8,9,10] aux = StringVar() aux2 = StringVar() aux3 = StringVar() s1 = Spinbox(root,textvariable = aux, values = arr1).place(x=300,y=100) s2 = Spinbox(root,textvariable = aux2, values = arr2).place(x=300,y=150) caja = Entry(root, textvariable =aux3).place(x=300,y=250) b1 = Button(root, text = "Generar",command = funcion).place(x=300,y=300) root.mainloop() |
domingo, 25 de noviembre de 2018
Numero aleatorio desde el numero n hasta el numero n P14
Suscribirse a:
Comentarios de la entrada (Atom)
No hay comentarios.:
Publicar un comentario