Skip to main content

U2 Python - PyCallFunction with keyword argument

  • June 28, 2023
  • 1 reply
  • 1 view

Manu Fernandes
Forum|alt.badge.img+2

hello, 

when we define a function like 

def funcname(a,b,c);
    return (a * b + c)

Can we use keyword argument syntax when calling a method/function ? 

like PyCallFunction("module","funcname",a=1,c=2,b=3) 

 or is it mandatory to use positional argument ? PyCallFunction("module","funcname",1, 3, 2)

many thanks



------------------------------
Manu Fernandes
------------------------------

1 reply

Manu Fernandes
Forum|alt.badge.img+2

hello, 

when we define a function like 

def funcname(a,b,c);
    return (a * b + c)

Can we use keyword argument syntax when calling a method/function ? 

like PyCallFunction("module","funcname",a=1,c=2,b=3) 

 or is it mandatory to use positional argument ? PyCallFunction("module","funcname",1, 3, 2)

many thanks



------------------------------
Manu Fernandes
------------------------------

by the way, can we use dict like this

items = "{'a': 1, 'b': 2, 'c': 3}"

PyCallFunction("module","funcname",**items)



------------------------------
Manu Fernandes
------------------------------