Question: [Python] Why will nothing print inside of the while loop? while True: con, addr = s_soc.accept() data = con.recv(4096).decode() data = data.split(',') print(Client name:
[Python] Why will nothing print inside of the while loop?
while True: con, addr = s_soc.accept() data = con.recv(4096).decode() data = data.split(',') print("Client name: " + data[0]) print("Server name: " + ServerName) rand = random.randint(1, 100) Sum = str(rand + int(data[1])) sendMsg = ServerName + "," + str(rand) + "," + Sum con.send(sendMsg.encode()) con.close() I know it's receiving the data because the data that gets sent back to the client is printed by the client so why won't anything print inside the server while loop? I tried just printing a random word in different locations in the while loop and nothing worked.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
