title: Python - Display Excel database in a grid
body: <p>I am an archaeologist processing results from an excavation trench that is laid out in a 6x6 square grid - each square is 5 m x 5 m.<br>
  I want to plot the distribution of the finds found in the excavation on the grid.</p>
  
  <p>I want to display some Excel database values in a 6x6 Python/Pygame grid.<br>
  Would someone please tell me <strong>how I should go about doing this?</strong><br>
  I think I know how to get Python to read an Excel document in <code>*.csv</code> but I can't display it in a grid.</p>
  
  <p><strong>Edit about Data</strong><br>
  A Snippet of the data can be found in the link. I would like to display the items from the 'classification' column in the grid. 
  <a href="http://i48.tinypic.com/2rdgn02.jpg" rel="nofollow">http://i48.tinypic.com/2rdgn02.jpg</a></p>
  
  <p><strong>For example,</strong><br>
  The number of 'preparation flakes' in each square either as numbers or as colours/shapes, where each square coresponds to the gridsquare number in column S. The database is getting quite large.<br>
  So,<br>
  Ideally I would like the program to read the database and update the square without me having to continually change the program.</p>
  
  <p>The code is now as follows.</p>
  
  <pre><code>&lt;import csv
   import os
  
   import pygame
  
  # the functions for display
  def disp(phrase,loc,screen):   # function to display phrase at loc on surface.
       s = font.render(phrase, True, (255,255,255))
       screen.blit(s, loc) #
  
  def text_display_csv(filename,surface):
      '''Display .csv file contents on surface'''
      f = csv.reader(open("Flint catalogue v1.7 4 Feb 13 2013.csv")) # open the csv file      in one line!
  
      for row in f:
          y = f.line_num                # assign y as Row no.
          for x,item in enumerate(row): # Get column number(x) and item
          disp(item, (64*x+10,64*y+10), surface) # display item
  
  
  
  pygame.init()
  pygame.font.init()
  font = pygame.font.SysFont("Courier",36) # font initialisation
  screen = pygame.display.set_mode((800,600))
  
  
  # the part you want to see
  text = [str(i) for i in range(36)] # raw data!
  text_display_csv(text,screen) # text is displayed
  pygame.display.update() # screen updated
  
  # Main loop, does nothing! :)
  running = True
  while running:
       for event in pygame.event.get():
           if event.type == pygame.QUIT:
               running = False
               pygame.quit()
               break
           if not running:
              break
  </code></pre>
  
  <p>If It is possible. i would like the results to be displayed in a fashion similar to the pic bellow where each number represents the number of 'preperation flakes in the square.
  <a href="http://i49.tinypic.com/f39hxv.png" rel="nofollow">http://i49.tinypic.com/f39hxv.png</a></p>
  
  <p>I am very grateful for any help and please say if this doesn't make sense</p>
  
  <p>Tom</p>