Same code works in "editpythonscript", but not "scripteditor"

I was studying event handler and I found this code on the forum. The same code works in “editpythonscript”, but doesn’t works in the new “scripteditor”. Can anyone tell me why?

print statements need to be in brackets in Python 3. You can also save as .py2 and open it in ScriptEditor, so it runs as python 2

What I meant was when I run it in ‘scripteditor’ with ironpython2 it still didn’t work. And like what you suggested, I did adjust it to meet python3 format and it run without errors. It just didn’t work…The only case it worked is to run it with “editpythonscripts”.

ViewHandler_py3.py (2.6 KB)
This is the code in python3. Thanks.

Ah Ok, I see. @eirannejad do you have an idea what’s going on with that script?

Hi,

Any luck? Thanks.

thanks for the reminder, I now logged it to make sure it gets addressed:
RH-83002 Script doesn’t work when run as python 3

@JJJJJJ See the YT for more info what to change to make that work.
here is the updated script:
ViewHandler_py3.py (2.3 KB)

2 Likes

This works! Thank you so much!!!