我收到格式错误的字符串错误。
这是我的测试
>>> eval("'Hello:: '+'fdsfds'")
'Hello:: fdsfds'
>>> import ast
>>> ast.literal_eval("'Hello:: '+'fdsfds'")
Traceback (most recent call last):
File "<pyshell#4>", line 1, in <module>
ast.literal_eval("'Hello:: '+'fdsfds'")
File "C:\Python27\lib\ast.py", line 80, in literal_eval
return _convert(node_or_string)
File "C:\Python27\lib\ast.py", line 79, in _convert
raise ValueError('malformed string')
ValueError: malformed string