- 博客(5)
- 收藏
- 关注
原创 TypeError: can only concatenate str (not “bytes“) to str
执行python脚本时提示“TypeError: can only concatenate str (not "bytes") to str”错误,如图示所示:原脚本vk = self.sk.get_verifying_key() vk_hex = binascii.hexlify(vk.to_string()) vk_x_separated = "" vk_x_str = vk_hex[0:64] for i...
2021-11-18 19:58:18 9907
原创 NameError: name ‘xrange‘ is not defined. Did you mean: ‘range‘?
用python3执行python2的脚本时提示错误“NameError: name 'xrange' is not defined. Did you mean: 'range'?”,如图所示:原脚本sk_hexlify_list = [] for i in xrange(len(sk_hexlify)-2, -2, -2): sk_hexlify_list.append(sk_hexlify[i:i+2]) sk_he...
2021-11-18 18:59:15 3257
原创 AttributeError: ‘int‘ object has no attribute ‘encode‘
用python3执行python2的代码时提示“AttributeError: 'int' object has no attribute 'encode'“”错误原脚本 self.sk = SigningKey.from_pem(sk_pem) sk_hex = "".join(c.encode('hex') for c in self.sk.to_string()) return default_sk.to_string() == self.sk....
2021-11-18 18:06:51 4013
原创 sequence item 0: expected str instance, int found
python3 中执行.join时提示TypeError: sequence item 0: expected str instance, int found原脚本:self.sk = SigningKey.from_pem(sk_pem) sk_hex = "".join(c for c in self.sk.to_string()) print(sk_hex)根据错误提示是c是int型,但是.join中需为str,因此用hex()方法将c转...
2021-11-18 17:48:11 353
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人