Ironpython2 or CPython3?

Hello,

Can Dynamo API recognize, which Python Engine version is currently being ran: IronPython2 or CPython3?


On my Revit 2022, the following:

import sys
OUT = sys.version

Always outputs ‘IronPython 2.7.9’ regardless, if I switch the upper dropbox to CPython3 or not.

hi,
an example

it is necessary to save when changing the engine

image

5 Likes

As always, thank you very much for the unselfish sharing of your knowledge @c.poupin ,

But I am completely confused now:
The way I work is, I click on Run/Executer, and close the Python node dialog. If I open the Python node dialog, my code changes have been saved, even though I never click on the ‘Save’ button.

So why is the ‘Save’ button necessary?

I think Dynamo makes a save of nodes in edition (or all nodes) before running the script

1 Like

Thank you @c.poupin,
I still don’t understand what is the purpose of the ‘Save’ button.
Thank you for solving the problem.

Imagine writing a bunch of code, and you get to a point where ‘this bit is good, but I want to do even more.’ Instead of having to close the window, then save the graph, this allows you to save with the editor open, then save the graph. It also enables switching the Python engine being used.

1 Like

Thank you for the reply @jacob.small ,
Maybe I formulated my question wrongly.

At the moment, the following is possible to be done in the Python node: one writes a code, and clicks on ‘Run’ button inside the Python node. Then closes the Python node editor window. Opens it again, and all the code I wrote is there, even though I didn’t use the ‘Save’ button inside the Python node editor.

It seems, the only purpose this ‘Save’ button serves, is to enable switching between IronPython2 and CPython3 engines.

It also allows for saving the code your editing without having to open and close the editor.

1 Like

Without having to open and close which editor? The Python node editor?

Yes. Saving this way is two steps.

The other way is four or five and you lose your spot in the code.

1 Like

Thank you once again for the clarification @jacob.small .

1 Like