I need to format something in this exact JSON format:
JSON.stringify(data,null,'\t');
How would I do this in python?
For Python 3:
import json
json.dumps(data, indent='\t')
If you're using Python 2 or need to support both versions, use the simplejson module:
import simplejson as json
The builtin json module in Python 2 indents only with spaces.
import simplejson as json instead.\t tabs. indent=4 will use 4 spaces instead of a tab.