Created
January 23, 2020 13:52
-
-
Save BMU-Verlag/50230df93740074a792fef4154e323ee to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def send(): | |
username = name_input.get() | |
message = message_input.get() | |
if message == '[exit]': | |
message = format_message(username, 'Signing out') | |
client_socket.send(message.encode('utf-8')) | |
print_message('\nSigned out') | |
client_socket.close() | |
sys.exit() | |
elif message: | |
print_message(f'\n{username} > {message}') | |
formatted_message = format_message(username, message).encode('utf-8') | |
client_socket.send(formatted_message) | |
message_input.delete(0, END) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment