9 Answers
+ 1
Roxana Haghgoo it's like this:
for x1, y1, x2, y2 in zip(X1_list, Y1_list, X2_list, Y2_list):
Canv.create_line(x1, y1, x2, y2)
or simply without zip:
for (x1, y1, x2, y2) in (X1_list, Y1_list, X2_list, Y2_list):
Canv.create_line(x1, y1, x2, y2)
+ 1
from tkinter import *
root = Tk()
canv = Canvas(root)
canv.pack()
canv.create_line (x1,y1,x2,y2)
+ 1
It depends on what the shape is going to be plotted.
But to be an example:
...
canv.pack ():
x1=A
y1=B
for i, j in zip (list1,list2):
canv.create_line (x1,y1,i,j)
x1=i
y1=j
List1 and list 2 are those you want to be the shape coordinates.
0
Can you share you code here ?
0
I mean that i want x1,y1,x2,y2 to choose from values of 4 lists with for loops
0
Roxana Haghgoo provide an example please, because there are many ways you can loop throught a list
0
X1_list=[ ]
Y1_list=[ ]
X2_list=[ ]
Y2_list=[ ]
#I want to create lines between every indexes of this 4 list
For ?????????? :
Canv.creat_line(x1,y1,x2,y2)
0
Thanks
0
Np