Skip to content

Comment on Python, the Web and Little Things on my Mindparent

Comments

Best resource I know if is to look at what the 2to3 tool does and try to minimize those items. Many items it fixes are possible to do correctly in 2.6+ (e.g. print(x) instead of print x, even if print still doesn't evaluate as an expression in 2.x).

http://docs.python.org/library/2to3.html#to3-fixers

You can use:

  from __future__ import print_function
And then print() should work as expected in Python 2.6+. That is, print(1, 2, 3) will print '1 2 3' instead of '(1, 2, 3)'.
AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.