Waiting for connection...
Accept new connection from 127.0.0.1:52348...
Exception in thread Thread-1:
Traceback (most recent call last):
File "C:\Users\sw\AppData\Local\Programs\Python\Python38\lib\threading.py", li
ne 932, in _bootstrap_inner
self.run()
File "C:\Users\sw\AppData\Local\Programs\Python\Python38\lib\threading.py", li
ne 870, in run
self._target(*self._args, **self._kwargs)
File "E:\java\tcpServer.py", line 24, in tcplink
sock.send('Hello, %s!' % data.decode('utf-8').encode('utf-8'))
TypeError: a bytes-like object is required, not 'str'
优惠传送门s
这是服务端的报错
把服务端的
换成
就好了