如果我有一个由命令dic.keys()
形成的列表,如下所示:
[
"['my', 'modem']", "['technical', 'schematics']", "['still', 'glad']",
"['spent', 'calling']", "['most', 'feared']", "['the', 'sysop']",
"['s', 'mystique']", "['had', 'been']", "['of', 'doom']",
"['i', 'hooked']", "['in', 'california']", "['my', 'ego']",
"['until', 'my']", "['didn', 't']"
]
键是由str()
构成的,所以看起来像list,但它是一个字符串。
我的问题是,你怎么能把每一个项目分开,使它看起来像这样
[ 'my', 'modem', 'techenical', ... ]
只需对每个字符串进行模式匹配:
相关问题 更多 >
编程相关推荐