tsxt-01

cook_dict={}
cookies_list = ['a=1','b=2','c=3']
for cookie in cookies_list:
    cook_dict[cookie.split('=')[0]]=cookie.split('=')[1]
    # print(cookie.split('=')[0])
    # print(cookie.split('=')[1])

print(cook_dict)
>>>{'a': '1', 'b': '2', 'c': '3'}

 

posted @ 2018-11-27 16:15  徐李帅  阅读(204)  评论(0编辑  收藏  举报