Python server-client tcp operation problem.

Asked 2 years ago, Updated 2 years ago, 15 views

*emphasized text*C:\Users\jjh89\AppData\Local\Programs\Python\Python36\python.exe C:/Users/jjh89/PycharmProjects/untitled/client.py

connected server!

input sachick(q to quit, 0 to initialize) : 2 + 5

Traceback (most recent call last):

File "C:/Users/jjh89/PycharmProjects/untitled/client.py", line 13, in s.sendall(message)

TypeError: a bytes-like object is required, not 'str'

Process finished with exit code 1

This error occurs

s.sendall(message)
print(s.recv(1000))

The 13th line is as follows The source has a server, and the client sends an operator and an operand to calculate the sum I'm implementing getting it back, but it's blocked over there

  print(message)
  conn.sendall(message)

The server side looks like this Please give me a solution

python

2022-09-21 20:16

1 Answers

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.