def get_terminal_size(defaultx=80, defaulty=25):
        try:
            import ctypes
        except ImportError:
            return defaultx, defaulty

        h = ctypes.windll.kernel32.GetStdHandle(-11)
        csbi = ctypes.create_string_buffer(22)
        res = ctypes.windll.kernel32.GetConsoleScreenBufferInfo(h, csbi)

        if res:
            (bufx, bufy, curx, cury, wattr,
             left, top, right, bottom, maxx, maxy) = struct.unpack(
                "hhhhHhhhhhh", csbi.raw)
            sizex = right - left + 1
            sizey = bottom - top + 1
            return (sizex, sizey)
        else:
            return (defaultx, defaulty)
Add a column function which takes an id as argument and
dataset/ETHPy150Open ipython/ipython-py3k/IPython/utils/terminal.py/get_terminal_size--crossover with--dataset/ETHPy150Open kwikteam/phy/phy/gui/widgets.py/Table.add_column