def textbar(maximum, value, fill="-", length=20):
    """print a text bar scaled to length with value relative to maximum"""
    percent = value / maximum
    num = int(round(length * percent))
    ret = ""
    for x in range(num):
        ret += fill
    return ret