[docs]class View:
"""Wrapper for the stdout messages directed to the end-user"""
[docs] def prompt_read(self, field):
return input("Enter the {}: ".format(field))
[docs] def print(self, *args, **kwargs):
print(*args, sep=" ", end="\r\n", **kwargs)
[docs] def tabulate(self, *args):
if len(args) < 2:
print(args)
mid_len = len(args) - 2
fmt="{left}{mid}{right}".format(left="{:<8}\t", mid=" {} "* mid_len, right="\t{:>10}")
print(fmt.format(*args))