Python 文本转字典:高效解析字符串数据
text = '13711111221,123456 13712211111,123456 1371111122,123456 '
lst = text.strip().split("\n")
result = {}
for item in lst: key, value = item.split(",") result[key] = value
print(result)
原文地址: https://www.cveoy.top/t/topic/nekj 著作权归作者所有。请勿转载和采集!