from __future__ import print_function

Ethan Furman ethan at stoneleaf.us
Sun Apr 24 14:48:55 EDT 2016


On 04/24/2016 11:14 AM, Joel Goldstick wrote:
> On Sun, Apr 24, 2016 at 2:05 PM, San wrote:

>> I want details explanation(why this statement used,when it can be used,etc) of following statement in python code
>>
>> "from __future__ import print_function"
>
> It lets python 2.7 use python 3.x print function instead of the 2.7
> print statement.  You might like some of the options, and your code
> will be easier to upgrade to 3.x if you decide to do that

When it can be used:  at the top of a python module; it must be the 
first executable line (only comments and doc-strings can be before it).

--
~Ethan~
	



More information about the Python-list mailing list