今天在進行一些簡單的socket編程的時候,遇到了幾個問題
1、AttributeError: module ‘socket’ has no attribute ‘AF_INET’
上面是socket編程的時候腳本名字就是socket出現了關鍵字
2、TypeError: a bytes-like object is required, not ‘str’
類型問題,這個在socket中,這個就是字符編碼格式不一樣,可以將字符串進行一次轉換encode()
今天在進行一些簡單的socket編程的時候,遇到了幾個問題
1、AttributeError: module ‘socket’ has no attribute ‘AF_INET’
上面是socket編程的時候腳本名字就是socket出現了關鍵字
2、TypeError: a bytes-like object is required, not ‘str’
類型問題,這個在socket中,這個就是字符編碼格式不一樣,可以將字符串進行一次轉換encode()
class MetaCls(type): def __new__(cls, *args, **kwargs): print("in MetaCls") # return super(Meta