python __future__ use

  At the beginning of plus from __future__ import after print_function sentence, even in python2.X, use print as you like python3.X bracketed use. python2.X in brackets do not need to print, and then in python3.X in need. 

Python2.7 #
Print "the Hello world"

# python3
Print ( "the Hello world")

  If a revision appeared some new features, but is not compatible with this feature and use the current version, that is, it is in this version it is not the language standard, so if I want to use, then you need to import the module from the future.

  Other examples:
    from __future__ Import Division,
    from __future__ Import absolute_import,
    from __future__ Import with_statement. And so
  add these, if your python version python2.X, so you have to use these functions in accordance with python3.X.
---------------------
Author: xiaotao_1
Source: CSDN
Original: https: //blog.csdn.net/xiaotao_1/article/details/79460365
Disclaimer: This article as a blogger original article, reproduced, please attach Bowen link!

Guess you like

Origin www.cnblogs.com/Rvin/p/11001991.html