Skip to main content

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


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)

Uploaded Source

Built Distribution

basic_options-0.1.0-py3-none-any.whl (5.1 kB view details)

Uploaded Python 3

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

Hashes for basic_options-0.1.0.tar.gz
Algorithm Hash digest
SHA256 c91079650bfa72b0c65e275b87f4e86be251a605677c4bbcd91c0e9f8a1dac5d
MD5 ab46d15f7f094422856dab14b93a842a
BLAKE2b-256 2c4f410b5ea514e19ff6a24986de0f9de5324494328a3d0e1580cd2426052226

See more details on using hashes here.

File details

Details for the file basic_options-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for basic_options-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 67258fe3845bac4c70a5a18e3ddfcc8dfaa1f797953ef475b9126a340860903a
MD5 eda411d9b3cf83f2ed1660eb8b550bd9
BLAKE2b-256 b093693dd0450e19ed9c40c35cdfc0180c491ca8e2bb1c1be3f3e30f18a3f0e3

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page