I have JSON data stored in the variable
I want to write this to a text file for testing so I don't have to grab the data from the server each time.
Currently, I am trying this:
obj = open('data.txt', 'wb') obj.write(data) obj.close
And I am receiving this error:
TypeError: must be string or buffer, not dict
How to fix this?