Closed zuhanit closed 3 years ago
You can define python class in python script and import it in epScript, but can't define any python class nor function solely in epScript.
Thanks! I solved this question using python class.
#mypy.py
import enum
class MyClass(enum.Enum):
FOO = 0,
BAR = 1
import mypy;
function afterTriggerExec() {
const k = EPD(Db(mypy.MyClass.FOO.name));
const s = StringBuffer(1230);
s.printf("{:t}", k); // 'FOO'
}
In python over version 3.4, we can use
enum
like below:But when I tried to use Enum, euddraft push
General Syntax Error
. it seems like Object doesn't support inheritance, just convert intoEUDStruct
. is there any way to use Enum in epScript? or instead, Can I create custom Python Class in epScript?