code: def write_right(self, msg, thread_lock=None):
          
          if self.cursesScreen:
              if thread_lock is not None:
                  thread_lock.acquire()
              try:
                  a_msg = msg.strip()
                  self.cursesScreen.addstr(0, self.width + 5 - len(a_msg) - 1, a_msg.replace("\r", "").replace("\n", ""))
              except:
                  a_msg = msg.encode('utf-8', 'replace').strip()
                  self.cursesScreen.addstr(0, self.width + 5 - len(a_msg) - 1, a_msg.replace("\r", "").replace("\n", ""))
              self.cursesScreen.refresh()
              if thread_lock is not None:
                  thread_lock.release()
docs: msg may or may not be encoded