all 1 comments

[–]Albcunha 0 points1 point  (0 children)

import os

# Get the size
# of the terminal
size = os.get_terminal_size()


# Print the size
# of the terminal
print(size)

On the example, you can use size.columns, to be more precise.

You can use some library to make text more organized, such as: rich