File: basic.py

package info (click to toggle)
python-evalidate 2.0.5-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 144 kB
  • sloc: python: 500; makefile: 3
file content (11 lines) | stat: -rwxr-xr-x 217 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
#!/usr/bin/env python3

from evalidate import Expr, EvalException

src = 'a + 40 > b'
# src="__import__('os').system('clear')"

try:
    print(Expr(src).eval({'a':10, 'b':42}))
except EvalException as e:
    print(e)