Python3.x与Python2.x的差异用法
1,Python2.x:import urllib2
Python3.x:import urllib.request
2,Python2.x: urllib2.URLError, e:
Python3.x:urllib.request.URLError as e:
3,Python2.x:print ‘hello world‘
Python3.x: print(‘hello world‘)
4,Python2.x:有raw_input和input
Python3.x:将raw_input和input进行了整合,只有input
时间: 2024-11-01 11:46:14