code: def get_position(self, subject):
          
          cursor = self.textCursor()
          if subject == 'cursor':
              pass
          elif subject == 'sol':
              cursor.movePosition(QTextCursor.StartOfBlock)
          elif subject == 'eol':
              cursor.movePosition(QTextCursor.EndOfBlock)
          elif subject == 'eof':
              cursor.movePosition(QTextCursor.End)
          elif subject == 'sof':
              cursor.movePosition(QTextCursor.Start)
          else:
              # Assuming that input argument was already a position
              return subject
          return cursor.position()
docs: Get offset in character for the given subject from the start of
             text edit area