Clear input text after user has typed it

master
Mikołaj Lubiak 3 months ago
parent 702432c92a
commit ccf5142121
  1. 9
      client.py
  2. 1
      server.py

@ -37,10 +37,11 @@ class client():
receiving.daemon = True
receiving.start()
while True:
msg = input()
msg = f"\nClient: {msg}\n"
print(msg)
self.sMsg(msg)
msg = input()
print('\033[1A' + '\033[K', end='')
msg = f"\nClient: {msg}\n"
print(msg)
self.sMsg(msg)
if __name__ == '__main__':
check_call('clear')

@ -37,6 +37,7 @@ class Server:
self.receiving.start()
while True:
msg = input()
print('\033[1A' + '\033[K', end='')
msg = f"\nADMIN: {msg}\n"
print(msg)
self.client.send(self.f.encrypt(msg.encode()))

Loading…
Cancel
Save