我记得曾经使用一个库来帮助我转换这样的字符串,
myString = "myKeyword=myValue&myKeyword2=myValue2"
...到字典:
myDict = {'myKeyword':'myValue',"myKeyword2":"myValue2"}
我正在寻找一些stackoverflow的帖子,但没有解决我的问题。
我要转换的字符串:
mc_gross=0.01&invoice=x36&protection_eligibility=Eligible&payer_id=LAX8695MJNYR8&payment_date=10%3A09%3A28+Jul+11%2C+2019+PDT&payment_status=Completed&charset=windows-1252&first_name=test&mc_fee=0.01¬ify_version=3.9&custom=&payer_status=verified&business=gera_meneses-facilitator%40outlook.com&quantity=1&verify_sign=A0.PoBsRDYqp1u5wu92rPQ6WipdwALNo9.H5LOaRA0dUzsVx3SMrIVI2&payer_email=gera_meneses-buyer%40outlook.com&txn_id=71G29196TW636850K&payment_type=instant&last_name=buyer&receiver_email=gera_meneses-facilitator%40outlook.com&payment_fee=&shipping_discount=0.00&receiver_id=KYSBU8P5YBALY&insurance_amount=0.00&txn_type=web_accept&item_name=%5B%27pruebabarata%27%5D&discount=0.00&mc_currency=MXN&item_number=&residence_country=MX&test_ipn=1&shipping_method=Default&transaction_subject=&payment_gross=&ipn_track_id=8e3cf011a3170