def write(domain, key, value=None, user=kCFPreferencesCurrentUser, host=kCFPreferencesAnyHost): """Writes value as the value for key in domain, also accepts a dictionary of multiple key_value pairs to write""" domain = Preferences(domain, user, host) if type(key) is dict: domain.set_multiple(key) elif value is not None: domain[key] = value