2 de octubre de 2018

Practica 25: Creacion de un poligono

from Tkinter import *

ventana=Tk()
ventana.title('Hacer un pentagono')
ventana.config(bg='gray')
ventana.geometry('500x500')

def poligono(ventana):
    panel = Canvas(width = 500, height = 400, bg='white')
    panel.pack()
    panel.create_polygon(140, 40, 300, 40, 400, 140, 40, 140,  width = 5, fill= 'white', outline = 'black' )

boton1 = Button(ventana, text = 'Hacer poligono', command = lambda:poligono(ventana))
boton1.pack()

ventana.mainloop() 

No hay comentarios.:

Publicar un comentario