You can use the utility tputto query the number of rows and columns available in the terminal. You can execute it with subprocess.Popen:
>>> import subprocess
>>> tput = subprocess.Popen(['tput', 'cols'], stdout=subprocess.PIPE)
>>> int(tput.communicate()[0].strip())
180
The same principle can also be applied to query a variable $COLUMNSas mentioned by gregseth:
>>> tput = subprocess.Popen(['echo $COLUMNS'], shell=True, stdout=subprocess.PIPE)
>>> int(tput.communicate()[0].strip())
180
, curses , -, , , :
>>> import curses
>>> curses.setupterm()
>>> curses.tigetnum('cols')
180
, setupterm , , tigetnum.