近日, GITHUB上學習一個demo, 無奈做者是用 python2 寫的, 改了些常規的區別後, 報了這個錯:html
Python 3.6.4 (v3.6.4:d48eceb, Dec 19 2017, 06:04:45) [MSC v.1900 32 bit (Intel)] on win32 Type "help", "copyright", "credits" or "license" for more information. >>> import sys >>> sys.maxint Traceback (most recent call last): File "<stdin>", line 1, in <module> AttributeError: module 'sys' has no attribute 'maxint'
將 ``` sys.maxint ``` 改成 ``` sys.maxsize ```
這裏是官方文檔, py2 to py3python