Jan-10-2020, 08:58 AM
Try to put a sleep inside the while True block:
def read_input(self): while True: time.sleep(0.1) if not self.__alive: break if not self.input_queue.empty(): self.lock.acquire() while not self.input_queue.empty(): self.user_input = self.user_input + self.input_queue.get() self.user_input = self.user_input[:-1] if self.user_input: self.__input_cache.append(self.user_input.replace('\n', '')) self.lock.release() self.user_input = '' print('>', end='')
Almost dead, but too lazy to die: https://sourceserver.info
All humans together. We don't need politicians!
All humans together. We don't need politicians!