class Res(object):

    def __init__(self, res, delta):
        self.res = res
self.delta = delta

def __str__(self):
    return '%f +- %f' % (self.res, self.delta)
if __name__ == '__main__':
    x = Res(0.271, 0.001)
print(x)
python - pretty print errorbars