Written by

Senior Startups and Community Programs Manager at InterSystems Corporation
Question Evgeny Shvarov · Jun 25, 2023

How do I call Python functions with "_" symbol in the name?

Hi folks!

Consider I need to call a python function which name contains "_" symbol (which is quite often in Python). How it could be called from ObjectScript?

E.g. here is the code:

Set sm = ##class(%SYS.Python).Import("sample")

write sm.helloworld() ; function without _
white sm.hello_world() ; function with _ - won't compile.

Thanks in advance!

Product version: IRIS 2023.1

Comments

John Murray · Jun 25, 2023

Does this work?

write sm."hello_world"()
0