我试图创建server.py我一直收到此错误: TypeError:需要类似字节的对象,而不是'str'
这是我的代码:
from socket import *
def createServer():
serversocket = socket(AF_INET, SOCK_STREAM)
serversocket.bind(('localhost',9000))
serversocket.listen(5)
while(1):
(clientsocket, address) = serversocket.accept()
clientsocket.send("It works")
createServer()
我正在使用python 3.6