python dialog box input
Python hosting: Host, run, and code Python in the cloud!
Input dialogs let your user give you feedback or input. They appear in desktop applications once in a while.
wxPython supports input dialogs, they are included with the framework.
A typical wxPython dialog may look like:

Related course: Creating GUI Applications with wxPython
wxPython input dialog
The example code below creates an input dialog with wxPython:
#!/usr/bin/python |
A wxPython textbox can be added to a window using the function:
|
Where the first argument is the frame, the second argument is the label and the last argument is the window title.
The function below displays the dialog and waits for a user to press one of the buttons:
|
You can get the button pressed by picking one of these:
|
(the result is either one of these)
After input is been given, you can get the input text using dlg.GetValue() function.
Related course: Creating GUI Applications with wxPython
Leave a Reply: