COL_WIDTH = 11
def format(s):
    return (' '*COL_WIDTH + str(s))[-COL_WIDTH:]

def format_L(s):
    return (str(s)+' '*COL_WIDTH)[:COL_WIDTH]

dash_line = ('+' + '-'*COL_WIDTH)*3 + '+\n'

t = dash_line
header = True
f = open('scores.txt')
for line in f:
    x0,x1,x2 = [e.strip() for e in line.split(',')]
    t += '|' + format(x1) + \
         '|' + format(x2) + \
         '|' + format(x0) + '|\n'
    if header:
        t += dash_line
        header = False
t += dash_line
f.close()

f = open('scores_table.txt', 'w')        
f.write(t)
f.close()