Two errors in this path because of escape characters.
>>> s = "c:\users\accounts\desktop\reports" # Removed last \ File "<interactive input>", line 1 SyntaxError: (unicode error) 'unicodeescape' codec can't decode bytes in position 2-3: truncated \uXXXX escape >>> # Fix >>> s = "c:\\users\\accounts\\desktop\\reports\\" >>> s 'c:\\users\\accounts\\desktop\\reports\\' >>>Do no use single
\
in file paths.import json from pprint import pprint def read_json_config(): with open('c.json') as json_data: json_config_file = json.load(json_data) pprint(json_config_file) read_json_config()
Output:{'ClientID': '8477295f-405',
'ClientSecret': '10f35a425670847eb63d9b1954592d2b8305cd87e3',
'ConsoleName': 'UK PS',
'DomainController': '10.0.1.20',
'ReportFilePath': 'c:\\users\\accounts\\desktop\\reports',
'ReportName': 'Unprotected_Machines_',
'SearchDomain': 'dc=domain,dc=co,dc=uk',
'SearchUser': 'domain\\dap.l',
'SearchUserPassword': 'password'}