def readlinear(fname):
    """Read a linear table, each line becomes two consecutive elements.
    Comments begin with '#'.
    """
    f = open(fname, 'r')
    lines = f.readlines()
    f.close()
    table = []
    for l in lines:
        l = l.strip()
        if l and l[0] != '#':
            columns = l.split()
            table.append(int(columns[0],base=0))
            table.append(int(columns[1],base=0))
    return table