title: Replace '**' with 'math.pow' in Python
body: <p>I have some mathematical functions (represented as strings) in a file: </p>
  
  <pre><code>1+a**(b/(3*a+1))
  (1+a)**(b/(3*a+1))
  ...
  </code></pre>
  
  <p>How can I transform  all <code>**</code>s in my string to <code>math.pow</code>?</p>
  
  <p>Edit: What I'm trying to solve is the following : 
  I've a lot of this functions to evaluate, I can't spend too much time on one.</p>
  
  <p>Sometimes functions look like that : </p>
  
  <pre><code>(3**100**100**2)
  </code></pre>
  
  <p>Python try to evaluate it, which is very long. 
  I would like to have an error instead like : </p>
  
  <pre><code>&gt;&gt;&gt; math.pow(3, math.pow(100, 100))
  Traceback (most recent call last):
  File "&lt;stdin&gt;", line 1, in &lt;module&gt;
  OverflowError: math range error
  </code></pre>
  
  <p>Edit 2 : Thanx all for answering, I finally found how to do it, and your answers and comments helped me a lot. 
  I just had to force float division with next line at the top of my file : </p>
  
  <pre><code>      from __future__ import division
  </code></pre>