-
Notifications
You must be signed in to change notification settings - Fork 5.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use print() function in both Python 2 and Python 3 #925
Use print() function in both Python 2 and Python 3 #925
Conversation
Legacy __print__ statements are syntax errors in Python 3 but __print()__ function works as expected in both Python 2 and Python 3.
Just slightly confused here. There is no python3 for Jython. The latest version of Jython is 2.7.1. It would surely be reasonable if there were to be python3 support for Jython, but I thought I had read somewhere that there wouldn't be. |
Last commit by jeff5 about 2 years ago. |
Note that print() is a defined method in GhidraScript, so when you call it from a PythonScript, it's actually calling our defined Java method. |
Does that redirect happen even when |
I just tested this out and I was wrong, GhidraScript's print() method is not actually callable from our Jython environment, which was unexpected. And it looks like you don't need to import anything to use the built-in print() function...Jython 2.7.1 already knows about it somehow. |
Try print("A", "B") on Jython with and without the import as discussed at jython/book#6 (comment) |
The import has no effect on |
Known bug https://bugs.jython.org/issue2007 |
Closing... With 125 days left until Python 2 end of life, it is clear that an upgrade is not possible. |
Legacy print statements are syntax errors in Python 3 but print() function works as expected n both Python 2 and Python 3.