Skip to content

Config

General config file for the program settings. Saves the file as .cfg in the user folder.

Arguments

argumentvalue
userThe User class for the config
sectionThe configs section. default value; DEFAULT

Methods

section

setItem

getItem

removeItem

Example

py
user = User('com.author.example_name')
default = Config(user)

# fallback values
default.setItem('version', '1.0.0')
default.setItem('imissing', 'Hello World')

# set config value
config = default.section('config')
config.setItem('version', '2.3.0')

# Get
print(config.getItem('version'))
print(config.getItem('imissing'))

>> 2.3.0
>> Hello World

Not associated with or approved by Mojang Studios or Microsoft