Python String Parsing Floats -



Python String Parsing Floats -

this question has reply here:

convert fraction float? 9 answers

how alter '14/15' string float? trying extract info text file convert '1/3' float. float('1/3') doesn't work. thinking splitting 2 parts @ '/' 1 , 3 dividing, seems cludgy. there more pythonic way this? i'm using python 2.7

if trust input:

from __future__ import partition eval('14/15')

python python-2.7

Comments

Popular posts from this blog

c - Compilation of a code: unkown type name string -

java - Bypassing "final local variable defined in an enclosing type" -

json - Hibernate and Jackson (java.lang.IllegalStateException: Cannot call sendError() after the response has been committed) -