Product
Introducing SSO
Streamline your login process and enhance security by enabling Single Sign-On (SSO) on the Socket platform, now available for all customers on the Enterprise plan, supporting 20+ identity providers.
A package that provides a simple and user-friendly interface for creating interactive windows in Tkinter. Provides functions to create input windows, option list windows, alerts, information, errors and confirmation windows with options. Simplify user interaction with your program quickly and efficiently. One of the main functions is that it is possible to use patterns for certain answers, which allows requiring the user to have a date pattern, or input of numbers.
Readme
Dialoger is a Python package that provides a set of functions to create interactive dialog windows in Tkinter with ease.
You can install Dialoger using pip:
pip install dialoger
Dialoger provides a set of functions to create interactive dialog windows in Tkinter with ease. The functions are: ask
, askwithanswers
, confirm
, alert
, info
, error
and success
.
The ask
function creates a dialog window with a question and a text input. It returns the text inputted by the user.
title
: The title of the dialog window.question
: The question to be asked to the user.answer_type
: The type of the answer. Can be str
, int
, float
, alphanumeric
or password
.answer_default
(optional): The default answer. If None
, the text input will be empty.pattern
(optional): A pattern to validate the answer. # will be replaced by the number. For example, ##/##/####
can be used to ask for a date or ###.###.###-##
to ask for a CPF. If None
, no pattern will be used.allow_empty
(optional): If True
, the user can leave the text input empty. If False
, the user must input something.allow_cancel
(optional): If True
, the user can cancel the dialog window. If False
, the user must answer the question.import dialoger
date = dialoger.ask('Birth date''', 'What is your birth date?', 'str', pattern='##/##/####', allow_empty=False, allow_cancel=False)
print(f"You were born in {date}")
The askwithanswers
function creates a dialog window with a question and a list of choices. It returns the choice selected by the user.
title
: The title of the dialog window.question
: The question to be asked to the user.choices
: A list of choices.import dialoger
answer = dialoger.askwithanswers('Favorite color', 'What is your favorite color?', ['Red', 'Green', 'Blue'])
print(f"Your favorite color is {answer}")
The confirm
function creates a dialog window with a message and two buttons. It returns True
if the user clicks the first button, or False
if the user clicks the second button. The default buttons are "Yes" and "No", but you can change them by passing a list of strings as the choices
parameter.
title
: The title of the dialog window.message
: The message to be displayed to the user.choices
(optional): A list of strings to be used as the buttons. The first string will be used as the first button, and the second string will be used as the second button. If None
, the default buttons will be used.import dialoger
answer = dialoger.confirm('Confirm', 'Are you sure you want to delete this file?')
if answer:
print('File deleted')
else:
print('File not deleted')
The alert
, info
, error
and success
functions create a dialog window with a message and a button. They don't return anything.
title
: The title of the dialog window.message
: The message to be displayed to the user.import dialoger
dialoger.alert('Alert', 'This is an alert')
dialoger.info('Info', 'This is an info')
dialoger.error('Error', 'This is an error')
dialoger.success('Success', 'This is a success')
Dialoger is licensed under the MIT License. See LICENSE for more information.
Contributions are welcome! You can contribute by opening an issue or submitting a pull request.
Dialoger was created by Guilherme Saldanha.
FAQs
A package that provides a simple and user-friendly interface for creating interactive windows in Tkinter. Provides functions to create input windows, option list windows, alerts, information, errors and confirmation windows with options. Simplify user interaction with your program quickly and efficiently. One of the main functions is that it is possible to use patterns for certain answers, which allows requiring the user to have a date pattern, or input of numbers.
We found that dialoger demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Streamline your login process and enhance security by enabling Single Sign-On (SSO) on the Socket platform, now available for all customers on the Enterprise plan, supporting 20+ identity providers.
Security News
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.