Pages

Sunday, December 6, 2015

[Python] from __future__ import

Quick note:

This statement always confuses me

from __future__ import print_function
This is a interpreter directive that does a special import that use implementation in last Python.

For example, use Python 2.x and import a module named as print_function in Python3.x. This also reduce the works have to done from conversion from Python 2.x to Python 3.x

No comments:

Post a Comment