gpt4 book ai didi

python - list.__str__ 反转

转载 作者:太空宇宙 更新时间:2023-11-03 13:48:42 25 4
gpt4 key购买 nike

<分区>

Possible Duplicate:
Converting a string that represents a list, into an actual list object

有这样一个字符串:

"[81, 102, 114, 132, 194, 210, 228, 317, 357, 358, 379, 396, 407, 417, 418, 420, 470, 471, 506, 526, 533, 538]"

如何轻松解析成对应的列表?

我知道我可以使用 re 模块或按 ", " 等拆分

有没有现成的功能可以做到这一点?

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com