eval()的作用:
1.计算字符串中有效的表达式,并返回结果
In [1]: eval('1+1')
Out[1]: 2
2.将字符串转成相应的对象(如list、tuple、dict和string之间的转换)
>>> a = "[[1,2], [3,4]]"
>>> b = eval(a)
>>> b
[[1, 2], [3, 4]]
3.将利用反引号转换的字符串再反转回对象
>>> list = [1,2]
>>> `list`
'[1, 2]'
>>> type(`list`)
<type 'str'>
>>> type(eval(`list`))
<type 'list'>
>>> a = eval(`list`)
>>> a
[1, 2]