Skip to content

Instantly share code, notes, and snippets.

View UnknownAMD's full-sized avatar

HexDev UnknownAMD

  • Starbound Games
View GitHub Profile
@UnknownAMD
UnknownAMD / a.py
Last active June 10, 2025 19:28
thing
from math import sin, cos, tan, exp, log, sqrt, pow, pi, e
def parse_function(expr):
def f(x):
try:
return eval(expr, {"x": x, "sin": sin, "cos": cos, "tan": tan,
"exp": exp, "log": log, "sqrt": sqrt,
"pow": pow, "pi": pi, "e": e, "__builtins__": None})
except:
return None