title: Convert Python strings into floats explicitly using the comma or the point as separators
body: <p>How can I explicitly tell python to read a decimal number using the point or the comma as a decimal separator? I don't know the localization settings of the PC that will run my script, and this should not influence my application, I only want to say:</p>
  
  <pre><code>f = read_float_with_point("3.14")
  </code></pre>
  
  <p>or</p>
  
  <pre><code>f = read_float_with_comma("3,14")
  </code></pre>
  
  <p>I think that writing</p>
  
  <pre><code>def read_float_with_comma(num):
      return float(num.replace(",", ".")
  </code></pre>
  
  <p>is not secure, because I don't know the locale settings!</p>