I'm using PythonShell from Node to run a Python script that returns a Python dict like so (in Python):
{ "playedStatus": game['playedStatus'].encode('ascii'),
"awayTeamAbb": game['awayTeamAbb'].encode('ascii'),
"homeTeamAbb": game['homeTeamAbb'].encode('ascii'),
"sport": 'NFL'}
When the Python dict is passed back to Node it's in string format like so:
{'home': 'CHI', 'sport': 'NFL', 'playedStatus': 'UNPLAYED', 'away': 'SEA'}
I've tried to run this string through JSON.parse in a couple different ways to use it as a Javascript object. However, I continue to get a string back instead of an object.
let parsed_JSON = JSON.parse(JSON.stringify(python_string_object));
console.log(typeof parsed_JSON); //returns 'string'
What am I doing wrong? How can I convert this into an object?