title: Optimal way to use tkinter and openpyxl to iterate through a spreadsheet?
body: <p>I'm a complete Python beginner, trying to make a GUI which allows the user to select an Excel file, from which some data will be extracted and analyzed. For the GUI I am using tkinter, and for the Excel operations I am using openpyxl. <strong>The code that I currently have works, but when the Excel file selected is large, the runtime is stupidly long (a 10,000 row x 20 column spreadsheet took about an hour to iterate through, and just got slower as time went by). Also, the GUI stops responding for the duration of the iteration.</strong> I had previously made the program practically identically using MATLAB, and it worked beautifully, with the whole iteration process taking only one or two seconds, so something is definitely funky here. Now I know this is a problem with me and not Python, so I was hoping you guys could help point me in the right direction of how to fix it. </p>
  
  <p>Here are some simplified examples of what I'm working with to help illustrate my situation. I need to go through each row of the spreadsheet, check a certain value in that row to see if it matches what I want, and if it does, I store some data from that row. </p>
  
  <pre><code>wb = openpyxl.load_workbook(filename = 'some_garbage.xlsx', read_only=True).worksheets[0]
  all_data = wb.cell
  desiredColor = 'Purple'
  foodStorage = []
  
  for row in range(2, wb.max_row + 1):
      print(row)
      if(all_data(row, 1).value == desiredColor):
          foodStorage.append(all_data(row,2))
          print('I found purple! Yee')
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/QzwDq.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/QzwDq.png" alt="Example spreadsheet. Unfortunately my real data isn&#39;t about colors and foods"></a></p>
  
  <p><strong>Should I be using a module other than openpyxl for this task, or am I just making some mistake that keeps openpyxl from performing at its full potential? 
  Should I be using threading, either to speed up the iteration process, or to ensure that my GUI window doesn't go all "Not Responding" on me while the iteration is doing its thing?</strong> </p>
  
  <p>I tried to search for questions regarding similar issues, but I wasn't really able to find quite what I was looking for, most likely due to my lack of ability to put my problem into the proper words. So, I apologize profusely in advance for asking something which has probably been answered a million times before. I'd appreciate any help you could give, and thanks for your time.</p>