title: how to define a function from a string using python
body: <p>this is my code :</p>
  
  <pre><code>a = \
  '''def fun():\n
      print 'bbb'
  '''
  eval(a)
  
  fun()
  </code></pre>
  
  <p>but it shows error :</p>
  
  <pre><code>Traceback (most recent call last):
    File "c.py", line 8, in &lt;module&gt;
      eval(a)
    File "&lt;string&gt;", line 1
      def fun():
        ^
  SyntaxError: invalid syntax
  </code></pre>
  
  <p>so what can i do ,</p>
  
  <p>thanks</p>