from __future__ import XXX

from __future__ import division,
from __future__ import absolute_import,
from __future__ import with_statement. Wait. With
these, if your python version is python2.X, you have to use these functions as python3.X.

After adding the sentence from __future__ import print_function at the beginning, even in python2.X, you have to use print with parentheses like python3.X. In python2.X, print does not require parentheses, but in python3.X they do.

# python2.7
print "Hello world"

# python3
print("Hello world")

 

 

Undertake programming in Matlab, Python and C++, machine learning, computer vision theory implementation and guidance, both undergraduate and master's degree, salted fish trading, professional answers please go to know, please contact QQ number 757160542 for details, if you are the one.

 

Guess you like

Origin blog.csdn.net/weixin_36670529/article/details/113817905