Let's say you have Python including variable-length arguments methods. How can you call it from ObjectScript?
def test1(*args):
return sum(args)
def test2(**kwargs):
a1 = kwargs.get("a1",None)
a2 = kwargs.get("a2",None)
return a1+a2You can call this "a.py" from ObjectScript as below. For **kwargs argument, create Dynamic Object in ObjectScript and put it into methods with <variablename>... (3 dots) format.
set a=##class(%SYS.Python).Import("a")
write a.test1(1,2,3) ;; 6
set req={}
set req.a1=10
set req.a2=20
write a..png)



%20(2).jpg)

