title: How do I convert width and height (in pixels) to columns for use with the python library pyte?
body: <p><strong>Background</strong></p>
  
  <p>I'm working on a graphical ssh client in Python.  I'm using PySide for the GUI, a fork of Paramiko for the ssh interaction and a library called Pyte for the terminal emulation.  </p>
  
  <p><strong>The problem</strong></p>
  
  <p>I can't figure out how to correctly resize the pyte terminal in relation to the PySide QTextEdit being resized.  I can only seem to get the width and height of the QTextEdit in pixels, not columns and rows which is required by the pyte library's Screen.resize() function.</p>
  
  <p>Is there anyway to either 1. get the column and line count for the QTextEdit or 2. convert the pixel width and height to columns and lines in a manner that is accurate across all systems?</p>
  
  <p><strong>Proposed Solution</strong></p>
  
  <p>Replace the QTextEdit.resizeEvent() function with a custom resize event handler which will call the Screen.resize() function of pyte to resize the terminal to match the new size of the QTextEdit widget.</p>
  
  <p>If there is an easier solution I'm very open to ideas.</p>