Answered step by step
Verified Expert Solution
Question
1 Approved Answer
[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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started