Package: dialoger
DialogerDialoger is a Python package that provides a set of functions to create interactive dialog windows in Tkinter with ease.InstallationYou can install Dialoger using pip:pipinstalldialogerUsageDialoger provides a set of functions to create interactive dialog windows in Tkinter with ease. The functions are:ask,askwithanswers,confirm,alert,info,errorandsuccess.askTheaskfunction creates a dialog window with a question and a text input. It returns the text inputted by the user.Parameterstitle: The title of the dialog window.question: The question to be asked to the user.answer_type: The type of the answer. Can bestr,int,float,alphanumericorpassword.answer_default(optional): The default answer. IfNone, 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. IfNone, no pattern will be used.allow_empty(optional): IfTrue, the user can leave the text input empty. IfFalse, the user must input something.allow_cancel(optional): IfTrue, the user can cancel the dialog window. IfFalse, the user must answer the question.importdialogerdate=dialoger.ask('Birth date''','What is your birth date?','str',pattern='##/##/####',allow_empty=False,allow_cancel=False)print(f"You were born in{date}")askwithanswersTheaskwithanswersfunction creates a dialog window with a question and a list of choices. It returns the choice selected by the user.Parameterstitle: The title of the dialog window.question: The question to be asked to the user.choices: A list of choices.importdialogeranswer=dialoger.askwithanswers('Favorite color','What is your favorite color?',['Red','Green','Blue'])print(f"Your favorite color is{answer}")confirmTheconfirmfunction creates a dialog window with a message and two buttons. It returnsTrueif the user clicks the first button, orFalseif 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 thechoicesparameter.Parameterstitle: 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. IfNone, the default buttons will be used.importdialogeranswer=dialoger.confirm('Confirm','Are you sure you want to delete this file?')ifanswer:print('File deleted')else:print('File not deleted')alert, info, error and successThealert,info,errorandsuccessfunctions create a dialog window with a message and a button. They don't return anything.Parameterstitle: The title of the dialog window.message: The message to be displayed to the user.importdialogerdialoger.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')LicenseDialoger is licensed under the MIT License. SeeLICENSEfor more information.ContributingContributions are welcome! You can contribute by opening an issue or submitting a pull request.CreditsDialoger was created byGuilherme Saldanha.