Global OP Shortcut in python

Is it possible to access an operator in python using the Global OP Shortcut but through a string variable?

Gshortcut = mystring
print(op.Gshortcut)

getattr(op, Gshortcut)

found this solution as well,

eval(f"op.{Gshortcut}")

1 Like

nice alternative