python2.7和python3.6不一样的地方整理
python2.7 python3
urllib2 urllib.request
Exception,e Exception as e
subprocess.Popen(stop_weblogic, stdout=subprocess.PIPE) subprocess.Popen(stop_weblogic, stdout=subprocess.PIPE,universal_newlines=True)
commands.getstatusoutput(cmd) subprocess.getoutput(cmd) subprocess.getstatusoutput(cmd)
subprocess.Popen().communicate() out = subprocess.Popen().communicate(),out = out.decode("UTF-8")
dict.has_key(key) key in dict | dict.__contains__('key')
dict.iteritems() dict.items()
python2.7和python3.6区别,升级变化,语法,类库
于 2023-05-30 15:08:53 首次发布