If your GUI needs are minimalist and your application is imperative
rather than event driven, then you may want to consider**EasyGUI**. As
the name suggests, it is extremely easy to use.
How to know when you might be able to use EasyGUI:
- You do not need menus.
- Your GUI needs amount to little more than displaying a dialog now
and then to get responses from the user.
- You do not want to write an event driven application, than is one in
which your code sits and waits for the the user to initiate operation,
for example, with menu items.
EasyGUI is available at http://www.ferg.org/easygui/.
Information about EasyGUI is provided in a text file in the
distribution.
EasyGUI provides functions for a variety of commonly needed dialog
boxes, including:
- A message box displays a message.
- A yes/no message box displays “Yes” and “No” buttons.
- A continue/cancel message box displays “Continue” and “Cancel”
buttons.
- A choice box displays a selection list.
- An enter box allows entry of a line of text.
- An integer box allows entry of an interger.
- A multiple entry box allows entry into multiple fields.
- Code and text boxes support the display of text in monospaced or
porportional fonts.
- File and directory boxes enable the user to select a file or a
directory.
6.3.1 A simple EasyGUI example
Here is a simple example that prompts the user for an entry, then
shows the response in a message box:
def testeasygui():
response = easygui.enterbox(message='Enter your name:',
title='Name Entry')
easygui.msgbox(message=response,
title='Your Response',
)