Skip to content Skip to sidebar Skip to footer

Can I Bind Python-2.7's `print` In Python-3.x, Allowing Me To Use `print` Without Parenthesis In Python-3.x?

I like python 2's print 'TEXT' which does not use without parenthesis, compared to print('TEXT') in python 3. Can I keep the python 2 print around to use by binding it to somethin

Solution 1:

In order to achieve what you want you need to define your own keyword, but you can't do this as you can't define or redefine language keywords without rewriting a compiler/interpreter/etc.


Post a Comment for "Can I Bind Python-2.7's `print` In Python-3.x, Allowing Me To Use `print` Without Parenthesis In Python-3.x?"