def save_json_dict(filename, json_dict):
 if isinstance(json_dict, dict):
  json_string = _json.dumps(json_dict, indent=4)
  lock.acquire()
  with open(filename, 'w') as f:
   f.write(json_string)
  lock.release()
 else:
  raise TypeError('json_dict was not a dictionary. not saving.')

def save_json_dict ( filename , json_dict ) : if isinstance ( json_dict , dict ) : json_string = _json . dumps ( json_dict , indent = 4 ) lock . acquire ( ) with open ( filename , 'w' ) as f : f . write ( json_string ) lock . release ( ) else : raise TypeError ( 'json_dict was not a dictionary. not saving.' )
save json to file .