Save
save function
Save variables or a dictionary to a JSON file.
Parameters
config_file
(str): The file to save the data to.**kwargs
(Any): The data to save. If a dictionary is passed as the only argument, it will be saved to the JSON file as is. If multiple keyword arguments are passed, they will be combined into a dictionary and saved to the JSON file.
Raises
FileNotFoundError
: If the directory forconfig_file
does not exist.PermissionError
: If the file cannot be opened for writing due to insufficient permissions.IOError
: If there is an error writing to the file.
Example
Last updated