This package provides a basic way to create configuration files, especially for tkinter GUI applictions.
Project description
Basic Options
This package provides a basic way to create configuration files, especially for tkinter GUI applictions.
# EXAMPLE USAGE
# Create an options class inheriting BasicOptions, and override the set_defaults function
class ExampleOptions(BasicOptions):
def set_defaults(self) -> None:
self.value_a = 1
self.valueB = "2"
self.c = [3, 4, 5]
self.delta = 6.0
self.Eee = {"value": 7}
# Create an instance of the options
example = ExampleOptions()
# Change a value in the options using .set_option() or item notation
example["delta"] += 0.6666
# You can do `example.delta += 0.6666`, however that would not activate the wrappers from .set_option_wrappers()
# Retreiving options can be done with .get_option(), or item notation
print(example.get_option("delta"))
print(example["c"])
# Loading and saving options can be done easily with .save_file(), .try_load_file() and .load_file()
# example2 = ExampleOptions().load_file("old_save.json").
# example2.save_file("new_save.json")
# Retreiving dictionaries and json strings with .to_json() and .to_dict()
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
basic_options-0.1.0.tar.gz
(3.9 kB
view details)
Built Distribution
File details
Details for the file basic_options-0.1.0.tar.gz
.
File metadata
- Download URL: basic_options-0.1.0.tar.gz
- Upload date:
- Size: 3.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.8.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c91079650bfa72b0c65e275b87f4e86be251a605677c4bbcd91c0e9f8a1dac5d |
|
MD5 | ab46d15f7f094422856dab14b93a842a |
|
BLAKE2b-256 | 2c4f410b5ea514e19ff6a24986de0f9de5324494328a3d0e1580cd2426052226 |
File details
Details for the file basic_options-0.1.0-py3-none-any.whl
.
File metadata
- Download URL: basic_options-0.1.0-py3-none-any.whl
- Upload date:
- Size: 5.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.8.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 67258fe3845bac4c70a5a18e3ddfcc8dfaa1f797953ef475b9126a340860903a |
|
MD5 | eda411d9b3cf83f2ed1660eb8b550bd9 |
|
BLAKE2b-256 | b093693dd0450e19ed9c40c35cdfc0180c491ca8e2bb1c1be3f3e30f18a3f0e3 |