def write_dictionary(self): config_dir = user_config_dir() filename = os.path.join(config_dir, 'DNA.json') with open(filename, 'w') as json_file: json.dump(self.dictionary, json_file)