【发布时间】:2020-01-27 20:37:12
【问题描述】:
我刚刚遇到了一个未解决的解决方案;)
我想将一个字符串放入列表列表中。
string = r'ABC:=[[0,0,110],[1,0,0,0],[1,0,0,0],[9e+09,9e+09,9e+09,9e+09,9e+09,9e+09]];'
new_string = string.strip().split('=')
# now new_string[1][:-1] does look like a list of lists but everything i tried i just got a string.
也许这里有人知道我怎么能得到它
data = [[0,0,110],[1,0,0,0],[1,0,0,0],[9e+09,9e+09,9e+09,9e+09,9e+09,9e+09]]
谢谢
【问题讨论】:
-
欢迎来到 Stack Overflow。请阅读:stackoverflow.com/help/how-to-ask
-
@ChrisMaes 我不认为重复项直接回答了 OP 的问题。 This 可能是更好的选择
-
@C.Nivs:我同意,但不能更改我的标志。