2006年01月04日 星期三 11:28
limodou,您好! Thanks. That's what I need. :) Good luck cry 在 2006-01-04 11:19:00 您写道: >在 06-1-4,cry<zyqmail at tom.com> 写道: >> python,您好! >> >> 有如下的一行: >> "a=123;b=456;c=789;" >> 解析成:{"a":"123";"b":"456";"c":"789"} >> 或者:[("a","123"),("b","456"),("c","789")] >> >> 用PYTHONIC的方法,怎么做呢? >> > >不知道算不算pythonic: > >dict([x.split('=') for x in a.split(';') if x]) > >-- >I like python! >My Blog: http://www.donews.net/limodou >NewEdit Maillist: http://groups.google.com/group/NewEdit >_______________________________________________ >python-chinese >Post: send python-chinese at lists.python.cn >Subscribe: send subscribe to python-chinese-request at lists.python.cn >Unsubscribe: send unsubscribe to python-chinese-request at lists.python.cn >Detail Info: http://python.cn/mailman/listinfo/python-chinese 致 礼! cry zyqmail at tom.com
Zeuux © 2025
京ICP备05028076号