(x,y)
Pythonでのリストのリストをどのようにウォークスルーできますか?
私はPythonでこのようなデータ構造を持っています。これは、のリストのリストです(x,y)
coords = [
[[490, 185] , [490, 254], [490, 312] ], # 0
[[420, 135] , [492, 234], [491, 313], [325, 352] ], # 1
]
x, y
リストを見て、各セットを取得したい:
# where count goes from 0 to 1
a_set_coord[] = coords[count]
for (tx, ty) in a_set_coord:
print "tx = " + tx + " ty = " + ty
しかし、私はエラーが発生します:
SyntaxError: ("no viable alternative at input ']'"
どうすればこれを修正できますか?