Skip to content

Cache

Cache any file.

Parameters

ParameterTypeValue
idstringThe cache id. The default will be an integer starting from 0 and increases for each Cache instance.
userUserThe userfolder to dump all cache files.
root_pathstringThe 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()

Not associated with or approved by Mojang Studios or Microsoft