Eval code validator
Project description
#
# see full details and documentation on bitbucket page of project
# https://bitbucket.org/yaroslaff/evalidate
#
import evalidate
src="a+b" # source code
c={'a': 1, 'b': 2} # context, variables which will be available for code
success,result = evalidate.safeeval(src,c)
if success:
print result
else:
print "ERROR:",result
# see full details and documentation on bitbucket page of project
# https://bitbucket.org/yaroslaff/evalidate
#
import evalidate
src="a+b" # source code
c={'a': 1, 'b': 2} # context, variables which will be available for code
success,result = evalidate.safeeval(src,c)
if success:
print result
else:
print "ERROR:",result
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
evalidate-0.3.tar.gz
(1.8 kB
view hashes)