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):
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() 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.0.6.tar.gz
(3.9 kB
view details)
Built Distribution
File details
Details for the file basic_options-0.0.6.tar.gz
.
File metadata
- Download URL: basic_options-0.0.6.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 | 33bf526b7e4c184f9b1e6e1abc18f64cb4ec69bd1c6b1fcf4384c8d03041f76b |
|
MD5 | f43855666179efad31eb2a3ee288ea5c |
|
BLAKE2b-256 | d8c2e3691a171db0081c0e33713fde4f068190bea41bf39de07e04361566b93a |
File details
Details for the file basic_options-0.0.6-py3-none-any.whl
.
File metadata
- Download URL: basic_options-0.0.6-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 | 8acb8ece6893ee0adaeee97dda85d39af0195802955cbd3cd40361b73fb3c44d |
|
MD5 | 2add629d325da8498768a4124bcc3bcc |
|
BLAKE2b-256 | ee7167d4ddbf652a8448b4483c72c0483f382365cfaee00696d93fe926209169 |