Cache
Cache any file.
Parameters
Parameter | Type | Value |
---|---|---|
id | string | The cache id. The default will be an integer starting from 0 and increases for each Cache instance. |
user | User | The userfolder to dump all cache files. |
root_path | string | The main path to remove from file paths. by default, this is the user's path. "C:/Users/YOUR_NAME/" |
Methods
exists
key
add_file
add_directory
remove_file
get_file
Example
py
cache = UserFolder.Cache()
cache.add_file('example1.png')
file = cache.get_file('example1.png')
print(file)
img = Image.open(file)
img.show()