exec_eval_test

简介

1
2
3
4
5
6
7
8
9
10
11
12
13
# coding:utf-8

dict_ = {}

a_ = "test = '我是你爸爸!孙子。'"
a = '1+3'
b = 'test'

print(str(eval(a,dict_)))
exec(a_,dict_)
print(str(eval(b,dict_)))