title: Python equivalent to C strtod
body: <p>I am working on converting parts of a C++ program to Python, but I have some trouble replacing the C function <a href="http://www.cplusplus.com/reference/clibrary/cstdlib/strtod/" rel="nofollow noreferrer">strtod</a>.
  The strings I'm working on consists of simple mathmatical-ish equations, such as "KM/1000.0". The problem is that the both constants and numbers are mixed and I'm therefore unable to use float().</p>
  
  <p>How can a Python function be written to simulate <code>strtod</code> which returns both the converted number and the position of the next character? </p>