带=号的字符串转成字典

 

s = 'a=1,b=2,c = 3'

dic = dict((l.split('=') for l in s.split(',')))

posted @ 2018-06-24 13:24  auxiaoliu  阅读(264)  评论(0编辑  收藏  举报