我有以下字符串:
string = 'amount=2000|captureDay=0|captureMode=AUTHOR_CAPTURE|currencyCode=978|merchantId=002020000000001|orderId=|transactionDateTime=2012-04-12T12:09:56+02:00|transactionReference=1212943|keyVersion=1|authorisationId=0020000006791167|complementaryCode=|maskedPan=|paymentMeanBrand=IDEAL|paymentMeanType=CREDIT_TRANSFER|responseCode=00'
我怎样才能从中做出查询。
我希望能够使用item['amount']
which 返回2000
编辑:
到目前为止我已经尝试过:
dict = string.split('|')
输出是:
['amount=2000', 'captureDay=0', 'captureMode=AUTHOR_CAPTURE', 'currencyCode=978', 'merchantId=002020000000001', 'orderId=', 'transactionDateTime=2012-04-12T12:09:56+02:00', 'transactionReference=1212943', 'keyVersion=1', 'authorisationId=0020000006791167', 'complementaryCode=', 'maskedPan=', 'paymentMeanBrand=IDEAL', 'paymentMeanType=CREDIT_TRANSFER', 'responseCode=00']