title: python code parser in python
body: <p>I need to parse python code line by line. Code:</p>
  
  <pre><code>ast.parse("""if True:
  print 'Yes' """)
  </code></pre>
  
  <p>returns AST object, but this line not:</p>
  
  <pre><code>ast.parse("if True:")
  </code></pre>
  
  <p>Is there way to parse that somehow? (except text parsing with RE) </p>
  
  <p>I need this to modify python code, line by line after user interactive input of python code. </p>