ScriptEditor issue when opening IronPython 2 scripts created elsewhere

Hi @eirannejad,

I only started playing with the ScriptEditor to try and create a plugin, but I ran into an issue when adding IronPython 2 scripts that were created outside of the ScriptEditor.

Let’s say I have a scirpt

print "test"

that I am adding the IronPython 2 script like this:
image

the ScriptEditor recognises the script as a python 3 script because it is missing the tag #! python 2. Also, adding the tag after the script has been added does nothing. I need to save the script with the tag before it is loaded into the ScriptEditor.

I would recommend that when loading an IronPython2 script into the ScriptEidor, that it appends that tag #! python 2 to the start of the script if it does not already exist.

Thanks!

Which Rhino version are you on (8.11 has a lot of improvements in projects)?
Add #! python 2 to the top of script or use .py2 for the file extension.

I will test this in our development branch to make sure “Add IronPython 2” always uses IronPython

RH-83675 Adding IronPython to project still uses python 3

3 Likes

RH-83675 is fixed in Rhino 8 Service Release 12 Release Candidate