杨__羊羊
您可以使用eval(https://docs.python.org/3/library/functions.html#eva)来评估您读入Python数据的文本。确保您信任数据源!除此之外,您显示的当前数据不是有效的 Python,因为缺少类型代码 如果您知道类型代码,则必须阅读文本、解析数据、手动添加类型代码,然后对其进行评估。更新 - 关于上述数据的有效性❯ python3Python 3.6.9 (default, Jul 17 2020, 12:50:27) [GCC 8.4.0] on linuxType "help", "copyright", "credits" or "license" for more information.>>> from array import array>>> [array([21,25,20]),array([12,24,23]),array([41,23,22])]Traceback (most recent call last): File "<stdin>", line 1, in <module>TypeError: array() argument 1 must be a unicode character, not list>>> ...有效的是例如...>>> [array("i",[21,25,20]),array("i",[12,24,23]),array("i",[41,23,22])][array('i', [21, 25, 20]), array('i', [12, 24, 23]), array('i', [41, 23, 22])]>>>