I'm trying to get this program to print the contents of a .csv file onto a GUI.
I've created in Tkinter. It mostly works, but I can't figure out a way to get each button to print the contents of the file it's linked to. 
At the moment I've created a variable that links to just one of the files, which shows that it works. 
The variable is "loadFiles", and the project it's set to open is "a_P.csv". Is there any way I can make the buttons link this variable to the relevant .csv file? 
The code is in this pastebin link: http://pastebin.com/ZP2pPvKA
The program searches for files ending in "_P.csv" in the same folder as it, so you may have to create a .csv with 7 objects in it.
you can use a lambda function in order to pass an argument to your load function. Unfortunately pastebin ist down right now so i cannot have a look at your code. The idea is something like this:
for filename in filenames:
    ...Button(...,command=lambda i=filename:loadFile(i),...
so in your loadFile function you have the filename as first parameter
How to make a button open a specific .csv file using Python Tkinter?