Friday, 15 July 2011

python - Parse the ouput of a variable -


I have the following variable, I need to parse the value in the error message, how can someone get it? ? "Error": 1, "Error Message": blank, "text": {"Result": "<< RequestGroupID> 11647 << Request Id & gt; Expected output: - blank

34382 > This is a JSON string, you need to use json.loads to parse it and it must be converted to a dictionary first.

  Import json ob = json.loads (message) print (ob ["error message"])  

However this will not allow you to any , no null .


No comments:

Post a Comment