python eval list get SyntaxError:无效语法

2024-09-26 18:15:52 发布

您现在位置:Python中文网/ 问答频道 /正文

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

Tags: defaultonhattypelineredsepfile

热门问题