Entradas

Mostrando entradas de marzo, 2019

1. Diálogos y mensajes con Tkinter

Imagen
En esta ocasión implementamos Tkinter para hacer un menú de botones #!/usr/bin/python # -*- coding: utf-8 -*- from Tkinter import * from tkMessageBox import * def pregunta (): askokcancel(title= 'Cancelar ok' ,message= '¿Desea cancelar?' ) def salir (): if askyesno( 'Verificar' , '¿Pasas mas de 3 horas en el celular?' ): showwarning( 'Si' , 'Haz otra actividad' ) else : showinfo( 'No' , 'Muy bien' ) def Libros (): if askyesno( "Libros" , "¿Te gusta leer libros?" ): showinfo( "Si" , "Muy bien" ) else : showerror( "No" , "Que mal" ) def Peliculas (): askquestion(title= "Pregunta" ,message= "¿Te gustan las peliculas?" ) def Cancelar (): askretrycancel(title= "Cancelar/Reintentar" ,message= "Reintentar o cancelar" ) def ...

5. Recopilación de polígonos del grupo

A continuación se presenta una pequeña recopilacion de algunos polígonos hechos por el grupo. from Tkinter import * def mostrar (num): v1 = Toplevel(v0) v1.title( 'Ventana hija' ) v1.protocol( 'WM_DELETE_WINDOW' , 'onexit' ) v1.config(bg= 'blue' ) v1.geometry( '800x500' ) if num == 1 : hola = Canvas(v1, width= 300 , height= 210 , bg= "black" ) hola.pack(expand=YES, fill=BOTH) hola.create_polygon( 130 , 420 , 130 , 100 , 200 , 100 , 200 , 420 , 400 , 420 , 400 , 100 , 470 , 100 , 470 , 420 , 130 , 420 , 400 , 100 , 200 , 100 , 470 , 420 , 400 , 420 , 130 , 100 , 470 , 100 , 200 , 420 , fill= "white" ) b3 = Button(hola, text= 'ocultar' , command= lambda : ejecutar(ocultar(v1))) ...