python2和python3的区别: python2获取的是整数 python3获取的是浮点数 print函数:(Python3中print为一个函数,必须用括号括起来:Python2中print为class) python2: print 'Python', python_version() print 'Hello, World!' print('Hello, World!') print "text", ; print 'print more text on the same
python2与python3两版本的区别是众所周知的,今天主要记录python下版本2 与版本3的区别 python2 In [7]: logfile = open('/tmp/mylog.log', 'a') In [8]: print >> logfile, 'writeen by python version 2' In [9]: logfile.close() In [10]: cat /tmp/mylog.log writeen by python version 2 python