The following code performed the python script gNetP0.py, and produced the output Desktop\gNetP0.csv, from Desktop\gDomain3_12.csv. However there was no visible indicator in MoI that python had done its job.
code:
var res = moi.filesystem.shellExecute('cmd /c C:\\Users\\orcha\\Desktop2\\gNetP0.py', '', true );
if ( res.output ) moi.ui.alert( res.output );
Maybe some parameter could be added to show the action occured?
Or the gNetP0.py could have a completed print(...) message added at end...
- Brian
ps:
https://stackoverflow.com/questions/89228/how-to-execute-a-program-or-call-a-system-command-from-python
"If you're on Python 3.5 or later, you can use the new subprocess.run function, which is a lot like the above but even more flexible and returns a CompletedProcess object when the command finishes executing."
"...There are serious security implications if any part of the string that you pass can not..."
|