w $zf(-100,"a='./DC hello'") Fetch return value of method in variable "a" from Python
In below command a is storing our return value from Python Script, hello is our device, our python script is returning device type against passing a parameter, this parameter is a device :
w $zf(-100,"a='./DC hello'")
Please help us to fetch return value of method in variable "a" returning from Python in cache.
Thanks in advance, experts
You could redirect the output of the python script to a file as described in
https://cedocs.intersystems.com/latest/csp/docbook/DocBook.UI.Page.cls?K...
or https://docs.intersystems.com/irislatest/csp/docbook/Doc.View.cls?KEY=BG...
and read the file in Cache.
Or better to create a rest call in python and call it in Caché
Thanks Danny for your time.
writing the output in file and reading is somehow not acceptable by my org.
Yes, API can help in this and going to implement the same.
Thanks a lot for sharing knowledge and for your time to look into this.
You can use PythonGateway to call Python code from InterSystems IRIS directly.
Example:
set sc = ##class(isc.py.Main).SimpleString("x='HELLO'", "x", , .x) write x >HELLO