Draw lines : Line « 2D « Python






Draw lines

Draw lines

from Tkinter import *

canvas = Canvas(width=300, height=300, bg='white')  
canvas.pack(expand=YES, fill=BOTH)                  

canvas.create_line(100, 100, 200, 200)             
canvas.create_line(100, 200, 200, 300)             
for i in range(1, 20, 2): 
    canvas.create_line(0, i, 50, i)

mainloop()
           
       








Related examples in the same category

1.Draw a lineDraw a line
2.Line with patternLine with pattern
3.Line widthLine width
4.Line colorLine color