Build an IDEASCRIPT executable including python script

6 posts / 0 new
Last post
totux
Offline
Joined: 09/21/2018 - 03:59
Build an IDEASCRIPT executable including python script

Hi,
I would like to create an .exe file from a macro I created which integrates a python script. My problem is that when I build the executable file and try to run it on another machine (without importing the pyhton script) it doesn't work.
Is there a way to create an executable which already integrates the python code, so that the final user does not have to receive also the .py script?
Also, is it possible to create an executable which doesn't require to be included in the 'Macros' folder of the IDEA project?
Thank you, Ttx

Brian Element's picture
Brian Element
Offline
Joined: 07/11/2012 - 19:57

Hello totux,

There is currently no way that I know of to integrate a python script within an IDEAScript exe file.  Some options would be to create a zip file of the exe file along with the python code.  Another option which is a bit more complicated is to have the IDEAScript create the python script by have it write the file.

The exe file should be able to run any where on your computer, it doesn't need to be in the macros folder, I just tried running an exe file on the desktop with no problems.

Thanks

Brian

totux
Offline
Joined: 09/21/2018 - 03:59

Thank you, Brian!
My main need is to obfuscate the python code in order to distribute it properly. I was wondering how this is performed in the plugins that the IDEA Lab section of this website offers (I am assuming that complex addons like the outlier detection one are written in Pyhton).
Thank you again and have a good day.
totux

Brian Element's picture
Brian Element
Offline
Joined: 07/11/2012 - 19:57

One way you can do it if your python skills are up to it is to create the entire script in Python by accessing the IDEA object and not use IDEAScript at all.  Then you can create an executable Python application.  You would then run the Python app that would access the IDEA object and perform your analysis.

totux
Offline
Joined: 09/21/2018 - 03:59

Thank you again, that’s a clever suggestion! Do you think this is the way the IDEA Lab outlier detection plugin is built?

Brian Element's picture
Brian Element
Offline
Joined: 07/11/2012 - 19:57

Yes it was.  If you local in your local library directory under macros you will see an outlier folder with an outlier.exe file.  This is the main file for the test.