我需要这个Perl字符串的Python模拟:
unpack("nNccH*", string_val)
Run Code Online (Sandbox Code Playgroud)
我需要nNccH*Python格式字符的数据格式.
在Perl中,它将二进制数据解压缩为五个变量:
但我不能用Python做到这一点
更多:
bstring = ''
while DataByte = client[0].recv(1):
bstring += DataByte
print len(bstring)
if len(bstring):
a, b, c, d, e = unpack("nNccH*", bstring)
Run Code Online (Sandbox Code Playgroud)
我从未用Perl或Python编写过,但我目前的任务是编写一个用Perl编写的多线程Python服务器...