Skip to content

Instantly share code, notes, and snippets.

@BMU-Verlag
Created January 23, 2020 13:52
Show Gist options
  • Save BMU-Verlag/50230df93740074a792fef4154e323ee to your computer and use it in GitHub Desktop.
Save BMU-Verlag/50230df93740074a792fef4154e323ee to your computer and use it in GitHub Desktop.
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