Re: None is None but not working

2017-09-28 Thread Sayth Renshaw
Thank you it was data["RaceDay"] that was needed. ata = r.json() if data["RaceDay"] is None: print("Nothing here") else: print(data["RaceDay"]) Nothing here Nothing here Nothing here {'MeetingDate': '2017-01-11T00:00:00', . Thanks Sayth -- https://mail.python.org/m

Re: None is None but not working

2017-09-27 Thread Gary Herron
On 09/27/2017 01:05 PM, Sayth Renshaw wrote: Hi I have got a successful script setup to rotate through dates and download json data from the url. As the api returns 200 whether successful I want to check if the file returned is not successful. when a file doesn't exist the api returns {'Race

Re: None is None but not working

2017-09-27 Thread Ben Finney
Sayth Renshaw writes: > When I call data = r.json() it says its type is None if it is not > successful so I thought it easier to check that. Can you show the interactive session where you do that check? >>> data = r.json() >>> data is None True That's what I understand your stateme

Re: None is None but not working

2017-09-27 Thread Daniele Forghieri
Il 27/09/2017 22:05, Sayth Renshaw ha scritto: Hi I have got a successful script setup to rotate through dates and download json data from the url. As the api returns 200 whether successful I want to check if the file returned is not successful. when a file doesn't exist the api returns {'Ra

None is None but not working

2017-09-27 Thread Sayth Renshaw
Hi I have got a successful script setup to rotate through dates and download json data from the url. As the api returns 200 whether successful I want to check if the file returned is not successful. when a file doesn't exist the api returns {'RaceDay': None, 'ErrorInfo': {'SystemId': 200, 'Err