go to post Sergey Lukyanchikov · Dec 13, 2019 In addition to Eduard's answer, a short example based on sending Python's exec command to Python (assuming Python 3.*) to execute a Python script stored in a file: (1) Create a testfile.py in some folder that Python has access to, add the following lines to testfile.py: f=open('disk:/path/to/your/folder/output.txt','w')print('Hello Python Gateway',file=f)f.close() Save and close testfile.py (2) Open IRIS Terminal, type and execute one by one the following commands: set sc=##class(isc.py.Callout).Setup() set sc=##class(isc.py.Main).SimpleString("exec(open('disk:/path/to/your/folder/testfile.py').read())",,,.sc) (3) Check the output.txt file that has been created in your folder
go to post Sergey Lukyanchikov · Aug 22, 2019 Hi Alex, for an unlimited tooling consider trying ML Toolkit (Python Gateway and R Gateway). These extensions enable usage of Python and R in-IRIS (terminal, COS classes, Ensemble BPLs). The results obtained via Python and R (can be combined in one class/BPL) are written to a Caché table and can be visualized using DeepSee (as a Dashboard or as a graphical image formed in Python/R). Like this one, for example:The BPL that generates the above example (please, note that the particular step is implemented in R while the surrounding steps are in Python):
go to post Sergey Lukyanchikov · May 8, 2019 Hi Mads, if building your Python code right in Caché is an option, please check PythonGateway - this is another way to deploy Python (and R - check RGateway). If you can also use Ensemble, then you will be able to create "adaptive processes" using those extensions. PyhtonGateway has also a docker packaging, if needed.