Currently, I'm using the python graphics module, and when a user wants to click on "choose" for a player, I want it to select the value for the player id according to a CSV file I have created. I was wondering how this could be achieved.

Because it is in a loop, I cannot individually assign a button (Rectangle) with a certain value or put in the script that it would equal a certain value.

Code:
from graphics import *

def PlayersPos(win,player):
    playerUpper = player.upper()
    File = open("players.csv","r")
    FileRead = File.read()
    y = 45
    FileReadRowSplit = FileRead.split('\n')

    for Rows in range(len(FileReadRowSplit)):
        FileReadCommaSplit = FileReadRowSplit[Rows].split(',')
        if playerUpper in FileReadCommaSplit[0]:
            PlayerText = Text(Point(FileReadCommaSplit[5],y),FileReadCommaSplit[0])
            PlayerText.draw(win)
            PositionText = Text(Point(265,y),FileReadCommaSplit[1])
            PositionText.draw(win)
            ClubText = Text(Point(FileReadCommaSplit[6],y),FileReadCommaSplit[2])
            ClubText.draw(win)
            ChooseRectangle = Rectangle(Point(500,y-13),Point(560,y+12))
            ChooseRectangle.draw(win)
            ChooseRectangleText = Text(Point(530,y),"Choose")
            ChooseRectangleText.draw(win)
            y+=25

Window = GraphWin("PlayersTest",600,800)
HeaderText = Text(Point(114,20),"Here are the returned players: ")
HeaderText.draw(Window)
PlayersPos(Window,"de")

while True:
    Window.getMouse()