Skip to content
Permalink
Browse files
Started trying to use the name of the user but not working
  • Loading branch information
hortonr6 committed Nov 8, 2017
1 parent d098c4b commit 0d443090e87527a2145c8e20a3b5e3f8ad886bd9
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
@@ -10,8 +10,16 @@ def receiveMessage():
sends EndOfMessage and displays the recieved messages on the user
interface'''

global username
username = "User"

message = thisSocket.recv(1024).decode()
print(message)
while (message != "EndOfMessage"):
if username == "User" and "YOURNAMEWILLBE" in message:
nameholder = message.split()[1:]
username = nameholder[1:]
continue
chatHistory.configure(state="normal")
thisSocket.send("Received".encode())
chatHistory.insert(tk.END, "Jeff: " + message + "\n")
@@ -30,7 +38,7 @@ def sendMessage(event):

thisSocket.send(sMessage.encode())
chatHistory.configure(state="normal")
chatHistory.insert(tk.END, "User: " + sMessage + "\n")
chatHistory.insert(tk.END, username + ": " + sMessage + "\n")
chatHistory.see(tk.END)
chatHistory.configure(state="disabled")
userInput.delete(0, tk.END)
Binary file not shown.

0 comments on commit 0d44309

Please sign in to comment.