def _get_terminal_size_tput():
 try:
  cols = int(subprocess.check_call(shlex.split('tput cols')))
  rows = int(subprocess.check_call(shlex.split('tput lines')))
  return (cols, rows)
 except:
  pass

def _get_terminal_size_tput ( ) : try : cols = int ( subprocess . check_call ( shlex . split ( 'tput cols' ) ) ) rows = int ( subprocess . check_call ( shlex . split ( 'tput lines' ) ) ) return ( cols , rows ) except : pass
get terminal size using tput .