title: Python - Understaning CSV Module and line_num object
body: <p>In my code, I would like to be able to print the line number if an error is found during processing (called in another piece of code), but I'm having trouble doing this using the <code>line_num</code> object. Here is my code for a .csv that is 4 rows long:</p>
  
  <pre><code>with open(inFile, 'U') as inFH:
      csvReader = csv.reader(inFH, delimiter = ',')
      header = csvReader.__next__()
      lineNum = csvReader.line_num
  
      for row in csvReader:
          print(lineNum)
  </code></pre>
  
  <p>when I execute this code, I see this in the console:</p>
  
  <pre><code>1
  1
  1
  1
  </code></pre>
  
  <p>My expectation is that I would see:</p>
  
  <pre><code>1
  2
  3
  4
  </code></pre>
  
  <p>It almost looks like the code is printing the index and not the line number...</p>