面對這樣的問題,而我想在Python 3使用2.7代碼:Python 2.7版的代碼在Python 3
TypeError Traceback (most recent call last)
<ipython-input-46-1eee8eed88cf> in <module>()
15 signature = hashlib.md5(concatenation.encode("utf-8")).digest()
16 #row[BVUSERTOKENCOLUMN] = binascii.hexlify(signature + valuestring)
---> 17 hashval = binascii.hexlify(signature + valuestring)
18 #print hashval
19 spamwriter.writerow([userid, date, maxage, hashval])
TypeError: can't concat bytes to str
歡迎StackOverflow上。請閱讀並遵守幫助文檔中的發佈準則。 [最小,完整,可驗證的示例](http://stackoverflow.com/help/mcve)適用於此處。在發佈您的MCVE代碼並準確描述問題之前,我們無法爲您提供有效的幫助。 – Prune
謝謝Prune :) – Astrom
謝謝Prune!對不起,我會嘗試從下一次更加解釋。感謝您作爲第一個計時器的理解。 – PJB