python eval list get SyntaxError:语法无效

时间:2017-08-14 02:26:58

标签: python list eval

Python 2.7.5 (default, Sep 15 2016, 22:37:39) 
[GCC 4.8.5 20150623 (Red Hat 4.8.5-4)] on linux2
Type "help", "copyright", "credits" or "license" for more information.

>>> shlst="_t=[['00','bank','yx'],['04','airport','jc']]"
>>> eval(shlst)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "<string>", line 1
    _t=[['00','bank','yx'],['04','airport','jc']]
      ^
SyntaxError: invalid syntax

0 个答案:

没有答案