Simplify the creation of GUI elements in the terminal
Project description
Here is a suggested README.md for the easy_gui_prompt project:
# easy_gui_prompt
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
A Python library to simplify the creation of GUI elements in the terminal using prompt-toolkit.
## Installation
Install easy_gui_prompt using pip:
```bash
pip install easy_gui_prompt
Usage
Import the EasyGUI
class:
from easy_gui_prompt import EasyGUI
Create an instance of EasyGUI
with a title:
gui = EasyGUI("My GUI")
Add GUI elements using the available methods:
# Yes/No prompt
result = gui.add_yes_no("confirm", "Do you want to proceed?", remember_value=True)
# Text input
name = gui.add_text("name", "Enter your name:", remember_value=True)
# Integer range
age = gui.add_int_range("age", "Enter your age:", 18, 100, remember_value=True)
Save the settings to a configuration file:
gui.save_settings()
Restore default settings:
gui.restore_default_settings()
Configuration
The library automatically saves user preferences to a configuration file located at ~/.easy_gui/easy_gui.yml
. This allows the GUI to remember the last entered values when remember_value=True
is used.
You can also access the configuration directly using the get_config
and save_config
functions:
from easy_gui_prompt import get_config, save_config
config = get_config("My GUI")
save_config("My GUI", config)
License
This project is licensed under the MIT License. See the LICENSE file for details.
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
Built Distribution
Hashes for easy_gui_prompt-2024.5.24.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | e1321e4e37dea2b6b6aa45d07a049a28fab306352b346e089e7a5828277e7bb7 |
|
MD5 | 0fb56dd3112ad81044c65488cee27d46 |
|
BLAKE2b-256 | 78e6ac5709fad110df5658f2115d754b1c5e526da5ec1eea7acd222e412ed701 |
Hashes for easy_gui_prompt-2024.5.24-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 421eea1a158d515ce0f0a2f53d9b5965fb1f08807670a2962bb91672ec6b613b |
|
MD5 | 1789a84d7911e3915b00e06d661a201a |
|
BLAKE2b-256 | e2c04e261aa2d05d0dbbbcfb570c094c1158f3eb9057c61961aefab11f8fb04f |