from Tkinter import * ventana=Tk() ventana.title('Figura poligono') ventana.config(bg='white') ventana.geometry('500x500') def poligono(ventana): pane1 = Canvas(width=450, height=400, bg='green') pane1.pack() pane1.create_polygon(60,140, 40, 220, 100, 160, 240, 200,240,160,240,220,300,160,260,200,320,200,360,180,380,160,360,160,400,140,380,120,340,100,280,100,260,60,220,40,220,100,100,120,80,60,60,40,width=4, fill='gray', outline='black') pane1.create_oval(330,120,350, 150, width=4, fill="black") boton = Button(ventana, text='Mostrar Figura', command = lambda:poligono(ventana)) boton.pack() ventana.mainloop()
Comments
Post a Comment