title: Using generators outside of a loop
body: <p>Relatively new to python so please excuse the newbie question, but google isn't helpful at this time.</p>
  
  <p>I have 100 very large xlsx files from which I need to extract the first row (specifically cell A2). I found this gem of a tool called openpyxl <a href="http://openpyxl.readthedocs.org/en/latest/api.html#openpyxl.reader.iter_worksheet.IterableWorksheet" rel="nofollow">which will iterate through my data files</a> without loading everything in memory. It uses a generaotor to get the relevant row on each call</p>
  
  <p>The thing that I can't get is how to initialize a generator outside of a loop. Right now my code is:</p>
  
  <pre><code>from openpyxl import load_workbook
  wb = load_workbook(filename = "merged01.xlsx", use_iterators= True)
  sheetName = wb.get_sheet_names()
  ws = wb.get_sheet_by_name(name = sheetName[0])
  row = ws.iter_rows() #row is a generator
  for cell in row:
      break
  print (cell[1].internal_value) # A2
  </code></pre>
  
  <p>But there has to be a better way of doing this such as:</p>
  
  <pre><code>...
  row = ws.iter_rows() #row is a generator
  cell = row.first # line I'm trying to KISS
  print (cell[1].internal_value) # A2
  </code></pre>