from __future__ import absolute_import作用

https://blog.csdn.net/caiqiiqi/article/details/51050800

from __future__ import division ,
from __future__ import absolute_import ,
from __future__ import with_statement 。等等
加上这些,如果你的python版本是python2.X,你也得按照python3.X那样使用这些函数。

在开头加上from __future__ import print_function这句之后,即使在python2.X,使用print就得像python3.X那样加括号使用。python2.X中print不需要括号,而在python3.X中则需要。

# python2.7
print "Hello world"

# python3
print("Hello world")

原文地址:https://www.cnblogs.com/xyzluck/p/12785564.html