Ask coding questions

← Back to all posts
How do I align text?
the_homie_me (1)

I've been trying to find the width of my screen, but nothing seems to work, How can I find it?

Vandesm14 (2728)

I assume you mean the width of the terminal. For that, just do:

import os
rows, columns = os.popen('stty size', 'r').read().split()