simple-gui-prompt
Easily generate GUI prompts without the hassle of making a whole GUI. Handy for scripts when all you really want is a text box or list or something.
Setup
pip install simple-gui-prompts
import prompts
Prompts supported
prompts.dialog(title, text, block=True): A simple popup box with a title and text that only has an OK button and returns None. If block=True (default), execution is blocked until the box is closed. If block=False, it returns immediately after creating the dialog
prompts.confirm(title, text, **kwargs): A popup which offers for the user to either confirm (returning True) or deny (returning False), with a closed window returning False. A yes= kwarg can be used to change the text on the confirm button (which defaults to 'OK'), and the no= kwarg can be used to change the text on the deny button (which defaults to 'Cancel'). Additionally, yesno=True can be used to replace the confirm and deny defaults with 'Yes' and 'No' respectively, in which case yes= and no= will be ignored if present.
prompts.text(title, text, **kwargs): A popup containing a text box, which returns a string representing the text that was put in, or None if the user cancelled. Allowed kwargs are:
canCancel=True: Defines whether the user gets a cancel button. This button causes the function to return None regardless of what was entered.
yes='OK': Text that appears on the OK button
no='Cancel': Text that appears on the cancel button
password=False: If True, hide the characters as they are entered.
validate=None: Can be set to a callable which will be passed the user string as the first parameter, and should return True or Flase depending on whether the input is valid. If it is invalid, another identical prompt will be generated, and only the valid input will be returned. If None, the string will be returned unconditionally
prompts.choice(title, text, choices, **kwargs): A popup which displays multiple choices, permitting the user to choose one of the choices, and returning the string that was chosen. Allowed kwargs are canCancel and no, behaving identically to the equivalent kwargs on prompts.getText.
prompts.choiceMulti(title, text, choices, **kwargs): This is identical to prompts.choice, except the user can choose multiple items, and the return value is a list of objects that were chosen. Therefore, it also permits the yes kwarg
Versioning
We use SemVer for versioning. For the versions available, see the tags on this repository.
License
This project is licensed under the MIT License - see the LICENSE.md file for details
Metadata
Release files for simple-gui-prompts 1.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| simple-gui-prompts-1.1.0.tar.gz | 3.3 kB | Without provenance | Details for simple-gui-prompts-1.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| simple_gui_prompts-1.1.0-py3-none-any.whl | Python 3 | none | any | Details for simple_gui_prompts-1.1.0-py3-none-any.whl |
Total release size: 7.4 kB
Release files / simple-gui-prompts-1.1.0.tar.gz
| Download URL | simple-gui-prompts-1.1.0.tar.gz |
|---|---|
| Size | 3.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
93c140b630b4d27258009bd372f660df296b8602159f7250e98522863b6d3304
|
|
BLAKE2b-256 checksum How to use checksums |
4aebf07348b47e22e3b91381093f5a6b6a1d124e9e3443b8e24b36e5f9568efa
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.0.0 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.8.4
|
Release files / simple_gui_prompts-1.1.0-py3-none-any.whl
| Download URL | simple_gui_prompts-1.1.0-py3-none-any.whl |
|---|---|
| Size | 4.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
82d7bc6b92d4cc80d72e919ecccd6caf722795cc75de911539722a113ad3dc80
|
|
BLAKE2b-256 checksum How to use checksums |
cfd9a3f5b4e605b106c7145b8d2e9d1986bc57f708ea790e77f2e71b69fb492b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.0.0 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.8.4
|
Security for simple-gui-prompts 1.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.