code: def get_unix_tput_terminal_size():
      
      import subprocess
      try:
          proc = subprocess.Popen(["tput", "cols"], stdin=subprocess.PIPE, stdout=subprocess.PIPE)
          output = proc.communicate(input=None)
          cols = int(output[0])
          proc = subprocess.Popen(["tput", "lines"], stdin=subprocess.PIPE, stdout=subprocess.PIPE)
          output = proc.communicate(input=None)
          rows = int(output[0])
          return cols, rows
      except (IOError, OSError):
          return None
docs: Get the terminal size of a UNIX terminal using the tput UNIX command.
      Ref: http://stackoverflow.com/questions/263890/how-do-i-find-the-width-height-of-a-terminal-window