migrate line bot webhook from python2 to python3
總算把原本用 python2 寫的 line bot 改成 python3 了。 有鑑於 python3 的成熟度越來越高,加上許多 library support; 以及目前正悄悄進行的 line bot 新功能 (先賣個關子)。 索性把整個平台轉到 python3 上, 這邊標注一下遇到那一些 python2、python3不同的地方(一小部份) Python2.7 Python3.4 備註 / / → int / → float; // → int urllib urllib.quota urllib.parse.quota urllib urllib.urlopen urllib.request.urlopen urllib urllib.urlencode urllib.parse.urlencode sys sys.maxint sys.maxsize The sys.maxint constant was removed, since there is no longer a limit to the value of integers. However, sys.maxsize can be used as an integer larger than any practical list or string index. It conforms to the implementation’s “natural” integer size and is typically the same as sys.maxint in previous releases on the same platform (assuming the same build options). https://docs.python.org/3.1/whatsnew/3.0.html#integers range xrange range python2 xrange = python3 range,pytho...