title: Python - File does not exist error
body: <p>I'm trying to do a couple things here with the script below (it is incomplete). The first thing is to loop through some subdirectories. I was able to do that successfully. The second thing was to open a specific file (it is the same name in each subdirectory) and find the minimum and maximum value in each column EXCEPT the first.</p>
  
  <p>Right now I'm stuck on finding the max value in a single column because the files I'm reading have two rows which I want to ignore. Unfortunately, I'm getting the following error when attempting to run the code:</p>
  
  <pre><code>Traceback (most recent call last):
    File "test_script.py", line 22, in &lt;module&gt;
      with open(file) as f:
  IOError: [Errno 2] No such file or directory: 'tc.out'
  </code></pre>
  
  <p>Here is the current state of my code:</p>
  
  <pre><code>import scipy as sp
  import os
  
  rootdir = 'mydir'; #mydir has been changed from the actual directory path
  data = []
  
  for root, dirs, files in os.walk(rootdir):
      for file in files:
          if file == "tc.out":
              with open(file) as f:
                  for line in itertools.islice(f,3,None):
                      for line in file:
                      fields = line.split()
                      rowdata = map(float, fields)
                      data.extend(rowdata)
                      print 'Maximum: ', max(data)
  </code></pre>