title: Use Python to remove lines in a files that start with an octothorpe?
body: <p>This seems like a straight-forward question but I can't seem to pinpoint my problem. I am trying to delete all lines in a file that start with an octothorpe (#) except the first line. Here is the loop I am working with:</p>
  
  <pre><code>for i, line in enumerate(input_file):
      if i &gt; 1:
          if not line.startswith('#'):
              output.write(line)
  </code></pre>
  
  <p>The above code doesn't seem to work. Does anyone known what my problem is? Thanks!</p>