Question
Abhinav Pandey · Sep 14, 2020

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

00
0 0 3 152

Replies

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