python--字符串类型的列表转换成列表类型
from ast import literal_eval apply_type = str([1,2,3]) new_list = literal_eval(apply_type) print(new_list) print(type(new_list)) # 此时的new_list的类型为list
python 中文名:蟒蛇,设计者:Guido van Rossum
python 中文名:蟒蛇,设计者:Guido van Rossum
from ast import literal_eval apply_type = str([1,2,3]) new_list = literal_eval(apply_type) print(new_list) print(type(new_list)) # 此时的new_list的类型为list