0、环境说明

linux 3.2.54

pyhton2.7

升级到

pyhton3.6


1、特性比较

catch语法:catch xxx, xx => catch xxx as xx

print语法:print xxx => print(xxx)

urllib2包:==> urllib.request

commands包: ==> subprocess

base64函数:decodestring => decodebytes

ConfigParser包: ==> configparse

整除: / => //

最大整数:sys.maxint => sys.maxsize

去掉unicode、long关键字,字符编码默认unicode,整数都为long

urllib.request.Request post数据需要转为字节型:bytes(data_str, 'utf-8')

import 包 需要补全路径

 

相关文章:

  • 2021-10-02
  • 2022-12-23
  • 2021-09-02
  • 2022-12-23
  • 2021-07-07
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-11-24
  • 2021-06-18
  • 2021-08-27
  • 2021-11-06
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案