Closed einarhaaland closed 2 years ago
In case I want to use eval:
def eval_expression(input_string):
code = compile(input_string, "<string>", "eval")
if code.co_names:
raise NameError(f"Use of names not allowed")
return eval(code, {"__builtins__": {}}, {})
simplest but perhaps worst way is just eval(instruction+"()"), check if python cleans input
maybe match instruction to closest matching function. add getMotions()...