9
我有串如下:從空間創建字典分隔的key = value字符串在Python
s = 'key1=1234 key2="string with space" key3="SrtingWithoutSpace"'
我想在轉換爲字典如下:
key | value -----|-------- key1 | 1234 key2 | string with space key3 | SrtingWithoutSpace
如何做到這一點在Python中?
應該發生什麼,如果你的字符串是''鍵1 =‘’富‘欄鍵2 =’baz'`? – 2011-01-21 22:50:28
我解析日誌文件的輸出,我不希望以任何其他格式輸出。 – 2011-01-24 16:00:20