Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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
You can’t perform that action at this time.