Dec-05-2018, 09:37 PM
Im very new to python and am a bit stuck. I have some code. I have a variable called data that is json that I need to access. The problem is I get the json but it has values that end up changing due to the system processing payment information. I need to access the json after its been updated. Id like to run a loop that checks that variable.
code:
data = json.loads(self.rfile.read( length ).decode('utf-8'))
order_status = data['order_status']['name']
if not order_status == "Awaiting Payment":
data = json.loads(self.rfile.read( length ).decode('utf-8'))
I want a loop that keeps checking order_status-> name and once its no longer saying "Awaiting Payment" set the data variable
Im not really sure how to do that
code:
data = json.loads(self.rfile.read( length ).decode('utf-8'))
order_status = data['order_status']['name']
if not order_status == "Awaiting Payment":
data = json.loads(self.rfile.read( length ).decode('utf-8'))
I want a loop that keeps checking order_status-> name and once its no longer saying "Awaiting Payment" set the data variable
Im not really sure how to do that