Advertisement
AntonioVillanueva

Test de 2 botones en Python tkinter

Jul 22nd, 2019
349
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.56 KB | None | 0 0
  1. #!/usr/bin/env py#!/usr/bin/env python
  2. # -*- coding: utf-8
  3. from tkinter import *
  4.  
  5. """ funciones asociadas a los botones , respuesta en el terminal """
  6. def aceptar():
  7.    print ("Acepta")
  8.    
  9. def cancelar():
  10.    print ("Cancela")  
  11.  
  12.  
  13. ventana =Frame ()
  14. ventana.pack(padx=20,pady=20)
  15.  
  16.  
  17. """ creo los dos botones en tkinter"""  
  18. botonAceptar=Button (ventana,text="Aceptar",font=("Verdana",15),background="green",command=aceptar).pack()
  19. botonCancelar=Button (ventana,text="Cancelar",font=("Verdana",15),background="red",command=cancelar).pack()
  20.  
  21. ventana.mainloop()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement