Clear input text after user has typed it

This commit is contained in:
Mikołaj Lubiak 2022-06-22 19:31:55 +02:00
parent 702432c92a
commit ccf5142121
2 changed files with 6 additions and 4 deletions

View File

@ -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')

View File

@ -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()))