How can I pass a “srcType” as an argument to a python function?


#1

How can I pass a “srcType” as an argument and use it in a python function?

def myFunc(srcTypeString):
    c3.srcTypeString.evalMetrics()
    ......

myFunc("PCPWell")
myFunc("Boiler")

#2

In Python specifically, try: getattr(c3, srcTypeString).evalMetrics(...).
In JS: c3Type(srcTypeString).evalMetrics(...)