title: convert AST node to python code
body: <p>Suppose I have the following string:</p>
  
  <pre><code>code = """
  if 1 == 1 and 2 == 2 and 3 == 3:
      test = 1
  """
  </code></pre>
  
  <p>The following code converts that string in a AST.</p>
  
  <pre><code>ast.parse(code)
  </code></pre>
  
  <p>Then I have a tree like:</p>
  
  <pre><code>Module(body=[&lt;_ast.If object at 0x100747358&gt;])
    If(test=BoolOp(op=And(), values=[&lt;_ast.Compare object at 0x100747438&gt;, &lt;_ast.Compare object at 0x100747a90&gt;, &lt;_ast.Compare object at 0x100747d68&gt;]), body=[&lt;_ast.Assign object at 0x100747e48&gt;], orelse=[])
  </code></pre>
  
  <p>I want to know if there is a way to convert the object <code>at.If</code> into the string <code>if 1 == 1 and 2 == 2 and 3 == 3:</code></p>
  
  <p>I know it can be done traversing the children node, but it's getting too complicated that way.</p>