title: How can I parse a PDB file in Python?
body: <p>I would like to create a function that can parse the following from any PDB file:</p>
  
  <ol>
  <li><p>The helix id of each helix and the length</p></li>
  <li><p>The sheetID, number of strands, and the total number of residues</p></li>
  </ol>
  
  <hr>
  
  <pre><code>f=open('5ogb.pdb')
  lines=f.readlines()
  
  print lines[337] 
  print lines[338]
  
  print "helixID= AA2"
  </code></pre>
  
  <p>How can I improve this code please? Thanks in advance.</p>