I have a list:
StoreItems = random.sample(set(['sword','pickaxe','toothpick','hammer','torch','saw']), 5)
and additional lines which add those 5 strings chosen onto my canvas, and give them binds.
XBASE, YBASE, DISTANCE = 300, 320, 50
for i, word in enumerate(StoreItems):
canvas.create_text(
(XBASE, YBASE + i * DISTANCE),
text=word, activefill="Medium Turquoise", anchor=W, fill="White", font=('Anarchistic',40))
found = canvas.find_closest(XBASE, YBASE)
if found:
canvas.itemconfig(found[0])
canvas.bind('<1>', Buy)
The problem is I need to assign each word a different tag bind, and currently it is giving all the words the same bind. So I cant make clicking saw
have a different result rather than clicking toothpick
.