Comment on Python, the Web and Little Things on my MindparentComments−SoftwareMaven15yBest 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−jacobolus15yYou 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)'.
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:
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)'.