I have this JSON in a file:
{
\"maps\": [
{
\"id\": \"blabla\",
\"iscategorical\
If you're using Python3, you can try changing your (connection.json
file) JSON to:
{
"connection1": {
"DSN": "con1",
"UID": "abc",
"PWD": "1234",
"connection_string_python":"test1"
}
,
"connection2": {
"DSN": "con2",
"UID": "def",
"PWD": "1234"
}
}
Then using the following code:
connection_file = open('connection.json', 'r')
conn_string = json.load(connection_file)
conn_string['connection1']['connection_string_python'])
connection_file.close()
>>> test1