Skip to content
← Back to Community
How do I align text?
Profile icon
the_homie_me

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

Voters
Profile icon
CamilleLombardi
Profile icon
KrishMinecraft
Profile icon
the_homie_me
Comments
hotnewtop
Profile icon
Vandesm14

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

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