Tkinter messageboxThe messagebox module is used to display the message boxes in the python applications. There are the various functions which are used to display the relevant messages depending upon the application requirements. The syntax to use the messagebox is given below. SyntaxParameters
The two options that can be used are default and parent. 1. default The default option is used to mention the types of the default button, i.e. ABORT, RETRY, or IGNORE in the message box. 2. parent The parent option specifies the parent window on top of which, the message box is to be displayed. There is one of the following functions used to show the appropriate message boxes. All the functions are used with the same syntax but have the specific functionalities. 1. showinfo()The showinfo() messagebox is used where we need to show some relevant information to the user. ExampleOutput: 2. showwarning()This method is used to display the warning to the user. Consider the following example. ExampleOutput: 3. showerror()This method is used to display the error message to the user. Consider the following example. ExampleOutput: 4. askquestion()This method is used to ask some question to the user which can be answered in yes or no. Consider the following example. ExampleOutput: 5. askokcancel()This method is used to confirm the user’s action regarding some application activity. Consider the following example. ExampleOutput: 6. askyesno()This method is used to ask the user about some action to which, the user can answer in yes or no. Consider the following example. ExampleOutput: 7. askretrycancel()This method is used to ask the user about doing a particular task again or not. Consider the following example. ExampleOutput: |
原创文章,作者:ItWorker,如若转载,请注明出处:https://blog.ytso.com/263082.html