Float doesn’t support precision configuration, only rounding and formating. You should use decimal instead:
>>> from decimal import *
>>> getcontext().prec = 2
>>> Decimal(1) / Decimal(7)
Decimal('0.14')
Python decimal: https://docs.python.org/2/library/decimal.html
2
solved How to add 0’s to a floating point number?