[dpdk-dev] [PATCH v4] devtools: script to track map symbols

Stephen Hemminger stephen at networkplumber.org
Mon Jun 21 20:14:52 CEST 2021


On Mon, 21 Jun 2021 16:35:31 +0100
Ray Kinsella <mdr at ashroe.eu> wrote:

> +def get_terminal_rows():
> +    '''Find the number of rows in the terminal'''
> +
> +    rows, _ = os.popen('stty size', 'r').read().split()
> +    return int(rows)
> +

Use standard Python function os.get_terminal_size or shutil.get_terminal_size() instead.
That way it would be portable to other OS.


More information about the dev mailing list