Skip to content

Instantly share code, notes, and snippets.

@nicanor-romerovenier
Last active September 19, 2016 21:30
Show Gist options
  • Save nicanor-romerovenier/d20d2c92edf80dbf22ed2eedbdc3044d to your computer and use it in GitHub Desktop.
Save nicanor-romerovenier/d20d2c92edf80dbf22ed2eedbdc3044d to your computer and use it in GitHub Desktop.
Programar Fácil - Tutorial de Python # 8 - Ejercicio 1
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import tkinter
from tkinter import messagebox
def accion_de_mi_boton():
respuesta = messagebox.askyesno("Mi dialogo emergente", "Te gusta mi programa?")
if respuesta:
print("La respuesta es True")
if not respuesta:
print("La respuesta es False")
mi_ventana = tkinter.Tk()
mi_ventana.geometry("640x480")
mi_boton = tkinter.Button(text="Mi botón!", command=accion_de_mi_boton)
mi_boton.pack()
mi_ventana.mainloop()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment