maybe something like this (2.6+)
from fractions import Fraction
float(sum(Fraction(s) for s in '1 2/3'.split()))
More Related Contents:
- how to parse the response in python?
- How to parse data in JSON format?
- How to convert an XML file to nice pandas dataframe?
- Retrieving parameters from a URL
- How can I split and parse a string in Python?
- What is the fastest way to parse large XML docs in Python?
- TypeError: expected a character buffer object – while trying to save integer to textfile
- Searching text in a PDF using Python?
- How can I use the python HTMLParser library to extract data from a specific div tag?
- Malformed String ValueError ast.literal_eval() with String representation of Tuple
- Is there a built in package to parse html into dom?
- How to create a dictionary from a line of text?
- Python code to remove HTML tags from a string [duplicate]
- Python regex, matching pattern over multiple lines.. why isn’t this working?
- Parsing SQL with Python
- Python BeautifulSoup XML Parsing
- How to parse/read a YAML file into a Python object?
- Using isdigit for floats?
- How to parse a string and return a nested array?
- How can I split a URL string up into separate parts in Python?
- parsing nested parentheses in python, grab content by level
- parsing a fasta file using a generator ( python )
- How can I parse (read) and use JSON?
- Is there a built-in or more Pythonic way to try to parse a string to an integer
- How can I parse (read) and use JSON in Python?
- Python urlparse — extract domain name without subdomain
- Equivalent to InnerHTML when using lxml.html to parse HTML
- fuzzy timestamp parsing with Python
- Split string at commas except when in bracket environment
- Python Parse CSV Correctly