diff --git a/.travis.yml b/.travis.yml index c55bf16..f2d164a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,6 +1,6 @@ language: python python: - - "2.7" +# - "2.7" # killed it to simplify a lot of things ... hopefully everyone is on Py3.x now - "3.4" - "3.5" - "3.6" @@ -14,4 +14,4 @@ services: # command to run tests script: pytest -install: pip install -r test-requirements.txt \ No newline at end of file +install: pip install -r requirements_for_tests.txt \ No newline at end of file diff --git a/easygui/boxes/about.py b/HISTORY.rst similarity index 95% rename from easygui/boxes/about.py rename to HISTORY.rst index f39955c..e84337c 100644 --- a/easygui/boxes/about.py +++ b/HISTORY.rst @@ -1,3 +1,4 @@ + """ .. moduleauthor:: easygui developers and Stephen Raymond Ferg @@ -10,7 +11,7 @@ except (SystemError, ValueError, ImportError): from derived_boxes import codebox -eg_version = '0.98.2-RELEASED' +eg_version = '0.98.3-RELEASED' egversion = eg_version @@ -24,6 +25,11 @@ def abouteasygui(): EASYGUI_ABOUT_INFORMATION = ''' +0.98.3 +======================================================================== +Update collections.abc import location (old location was deprecated since version 3.3, removed in version 3.10) +See: https://docs.python.org/3.9/library/collections.html#module-collections +for details Add some unit test coverage and test automation for TravisCI. 0.98.2 ======================================================================== @@ -48,13 +54,12 @@ def abouteasygui(): * Refactored the easygui.py file into several smaller files to improve our ability to manage the code * Added callbacks to allow for more dynamic dialogs. See the docs for usage. * Added class access to dialogs so properties may be changed. - * Improved button boxes ability to resize during window resize by converting to Tkinter grid from packer. KNOWN ISSUES ------------ - * (old) In the documentation, there were previous references to issues when using the IDLE IDE. I haven't - experienced those, but also didn't do anything to fix them, so they may still be there. Please report - any problems and we'll try to address them + * There were previous issues when using easygui with the IDLE IDE. + I hope I resolved these problems, however, I've never actually been able to repeat them. + Please report any problems found in github. OTHER CHANGES ------------- @@ -254,8 +259,3 @@ def abouteasygui(): * Fixed a bug that was preventing Linux users from copying text out of a textbox and a codebox. This was not a problem for Windows users. - -''' - -if __name__ == '__main__': - abouteasygui() diff --git a/MANIFEST.in b/MANIFEST.in index 4bf4483..c4bf456 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1 +1 @@ -include README.md \ No newline at end of file +include README.rst \ No newline at end of file diff --git a/README.md b/README.rst similarity index 100% rename from README.md rename to README.rst diff --git a/README.txt b/README.txt deleted file mode 100644 index 536dc0d..0000000 --- a/README.txt +++ /dev/null @@ -1,122 +0,0 @@ -EasyGUI -======= - -EasyGUI is a module for very simple, very easy GUI programming in Python. EasyGUI is different from other GUI -libraries in that EasyGUI is NOT event-driven. Instead, all GUI interactions are invoked by simple function calls. - -EasyGUI runs on Python 2 and 3, and does not have any dependencies beyond python and Tk. - -Example Usage -------------- - - >>> import easygui - >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) - 1 - >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') - 'OK' - >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) - 'Chocolate' - - -Full documentation is always available. - -For the most-recent production version: -. - -For our develop version which will be released next: -. - -0.98.2 -======================================================================== -Several updates and fixes thanks to Al and others. - -0.98.0 -======================================================================== -This is an exciting time for easygui. We continue to make good progress with refactoring as -well as some enhancements and bug fixes here and there. - -We would like to welcome Juanjo Denis-Corrales to the team. He is responsible for lots of good new work -this release. Of course we appreciate the work of everyone who contributed. - -NOTE: I decided in this release to change the API a bit. Please consult the function documentation for details. - -BUG FIXES ---------- - * Made changes guessing at fixes to any IDLE problems. Please report any problems found. - -ENHANCEMENTS ------------- - * Refactored the easygui.py file into several smaller files to improve our ability to manage the code - * Added callbacks to allow for more dynamic dialogs. See the docs for usage. - * Added class access to dialogs so properties may be changed. - * in integerbox, allowed lower and upper bounds to be None which means they aren't checked. - -KNOWN ISSUES ------------- - * There were previous issues when using easygui with the IDLE IDE. I hope I resolved these problems, however, - I've never actually been able to repeat them. Please report any problems found in github. - -OTHER CHANGES -------------- - * Centralized the Python 2 versus Python 3 "compatibility layer" into boxes/utils.py - - -0.97.4 -======================================================================== -This is a minor bug-fix release to address python 3 import errors. - -0.97.3 -======================================================================== -We are happy to release version 0.97.3 of easygui. The intent of this release is to address some basic -functionality issues as well as improve easygui in the ways people have asked. - -Robert Lugg (me) was searching for a GUI library for my python work. I saw easygui and liked very much its -paradigm. Stephen Ferg, the creator and developer of easygui, graciously allowed me to start development -back up. With the help of Alexander Zawadzki, Horst Jens, and others I set a goal to release before the -end of 2014. - -We rely on user feedback so please bring up problems, ideas, or just say how you are using easygui. - -BUG FIXES ---------- - * sourceforge #4: easygui docs contain bad references to easygui_pydoc.html - * sourceforge #6: no index.html in docs download file. Updated to sphinx which as autolinking. - * sourceforge #8: unicode issues with file*box. Fixed all that I knew how. - * sourceforge #12: Cannot Exit with 'X'. Now X and escape either return "cancel_button", if set, or None - -ENHANCEMENTS ------------- - * Added ability to specify default_choice and cancel_choice for button widgets (See API docs) - * True and False are returned instead of 1 and 0 for several boxes - * Allow user to map keyboard keys to buttons by enclosing a hotkey in square braces like: "Pick [M]e", which would assign - keyboard key M to that button. Double braces hide that character, and keysyms are allowed: - [[q]]Exit Would show Exit on the button, and the button would be controlled by the q key - []Help Would show Help on the button, and the button would be controlled by the F1 function key - NOTE: We are still working on the exact syntax of these key mappings as Enter, space, and arrows are already being - used. - * Escape and the windows 'X' button always work in buttonboxes. Those return None in that case. - * sourceforge #9: let fileopenbox open multiple files. Added optional argument 'multiple' - * Location of dialogs on screen is preserved. This isn't perfect yet, but now, at least, the dialogs don't - always reset to their default position! - * added some, but not all of the bugs/enhancements developed by Robbie Brook: - http://all-you-need-is-tech.blogspot.com/2013/01/improving-easygui-for-python.html - -KNOWN ISSUES ------------- - * In the documentation, there were previous references to issues when using the IDLE IDE. I haven't - experienced those, but also didn't do anything to fix them, so they may still be there. Please report - any problems and we'll try to address them - * I am fairly new to contributing to open source, so I don't understand packaging, pypi, etc. There - are likely problems as well as better ways to do things. Again, I appreciate any help or guidance. - -Other Changes (that you likely don't care about) ------------------------------------------------- - * Restructured loading of image files to try PIL first throw error if file doesn't exist. - * Converted docs to sphinx with just a bit of doctest. Most content was retained from the old site, so - there might be some redundancies still. Please make any suggested improvements. - * Set up a GitHub repository for development: https://github.com/robertlugg/easygui - * Improved output/packaging for Debian distribution - -EasyGui is licensed under what is generally known as -the "modified BSD license" (aka "revised BSD", "new BSD", "3-clause BSD"). -This license is GPL-compatible but less restrictive than GPL. diff --git a/bld.bat b/bld.bat deleted file mode 100644 index 87b1481..0000000 --- a/bld.bat +++ /dev/null @@ -1,8 +0,0 @@ -"%PYTHON%" setup.py install -if errorlevel 1 exit 1 - -:: Add more build steps here, if they are necessary. - -:: See -:: http://docs.continuum.io/conda/build.html -:: for a list of environment variables that are set during the build process. diff --git a/build.sh b/build.sh deleted file mode 100644 index 4d7fc03..0000000 --- a/build.sh +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/bash - -$PYTHON setup.py install - -# Add more build steps here, if they are necessary. - -# See -# http://docs.continuum.io/conda/build.html -# for a list of environment variables that are set during the build process. diff --git a/test_cases/SimpleCv.py b/demos/SimpleCv.py similarity index 90% rename from test_cases/SimpleCv.py rename to demos/SimpleCv.py index 01ad111..4f8e8c7 100644 --- a/test_cases/SimpleCv.py +++ b/demos/SimpleCv.py @@ -1,5 +1,7 @@ __author__ = 'Future Engineer' +import easygui.button_box + """ from: http://stackoverflow.com/questions/27873818/easygui-and-simplecv-typeerror-module-object-is-not-callable @@ -22,7 +24,7 @@ # Set a breakpoint code.interact("Code paused. Hit ctrl-D when ready to continue", local=dict(globals(), **locals())) while True: - eg.msgbox("""Welcome to my program!""", image = "pi.jpg") + easygui.button_box.msgbox("""Welcome to my program!""", image ="pi.jpg") msgbox("Select img ") nam=fileopenbox(filetypes=['*']) print(nam) diff --git a/test_cases/The Pirates of the Caribean Game.py b/demos/The Pirates of the Caribean Game.py similarity index 55% rename from test_cases/The Pirates of the Caribean Game.py rename to demos/The Pirates of the Caribean Game.py index eb84146..5ebf302 100644 --- a/test_cases/The Pirates of the Caribean Game.py +++ b/demos/The Pirates of the Caribean Game.py @@ -4,6 +4,8 @@ """ import sys +import easygui.button_box + sys.path.append('..') import easygui @@ -16,21 +18,21 @@ name = easygui.enterbox("Arrg its me Davy Jones whats your name ye scallywab") txt = "Do you fear DEATH {}? Lets play a game if ye win ye can go if ye lose" txt += " then you are my a sailer on my ship the flying dutchman forever AHAAAA!" -easygui.msgbox(txt.format(name)) -easygui.msgbox("The game be simple ye get 15 chances to guess a number between 1 and 100. Ye be ready?") +easygui.button_box.msgbox(txt.format(name)) +easygui.button_box.msgbox("The game be simple ye get 15 chances to guess a number between 1 and 100. Ye be ready?") while guess != secret and tries < 15: guess = easygui.integerbox("What's your guess "+name) if not guess: break if guess < secret: - easygui.msgbox(str(guess) + " is too low "+name) + easygui.button_box.msgbox(str(guess) + " is too low " + name) elif guess > secret: - easygui.msgbox(str(guess) + " is too high "+name) + easygui.button_box.msgbox(str(guess) + " is too high " + name) tries += 1 if guess == secret: - easygui.msgbox("Arrg ye got it in {}. You can go.".format(tries)) + easygui.button_box.msgbox("Arrg ye got it in {}. You can go.".format(tries)) if tries == 15: - easygui.msgbox("NO more guesses for ye. You're mine forever now {} !! AHAAHAA!!!".format(name)) + easygui.button_box.msgbox("NO more guesses for ye. You're mine forever now {} !! AHAAHAA!!!".format(name)) diff --git a/easygui/boxes/__init__.py b/demos/__init__.py similarity index 100% rename from easygui/boxes/__init__.py rename to demos/__init__.py diff --git a/test_cases/audio/intro.mp3 b/demos/audio/intro.mp3 similarity index 100% rename from test_cases/audio/intro.mp3 rename to demos/audio/intro.mp3 diff --git a/test_cases/audio/intro.ogg b/demos/audio/intro.ogg similarity index 100% rename from test_cases/audio/intro.ogg rename to demos/audio/intro.ogg diff --git a/test_cases/books.xml b/demos/books.xml similarity index 100% rename from test_cases/books.xml rename to demos/books.xml diff --git a/demos/button_box.py b/demos/button_box.py new file mode 100644 index 0000000..fcf8c00 --- /dev/null +++ b/demos/button_box.py @@ -0,0 +1,28 @@ +import os + +from easygui import buttonbox + + +def demo_buttonbox_1(): + print("hello from the demo") + value = buttonbox( + title="First demo", + msg="bonjour", + choices=["Button[1]", "Button[2]", "Button[3]"], + default_choice="Button[2]") + print("Return: {}".format(value)) + + +def demo_buttonbox_2(): + package_dir = os.path.dirname(os.path.dirname(os.path.realpath(__file__))) ;# My parent's directory + images = list() + images.append(os.path.join(package_dir, "python_and_check_logo.gif")) + images.append(os.path.join(package_dir, "zzzzz.gif")) + images.append(os.path.join(package_dir, "python_and_check_logo.png")) + images = [images, images, images, images, ] + value = buttonbox( + title="Second demo", + msg="Now is a good time to press buttons and show images", + choices=['ok', 'cancel'], + images=images) + print("Return: {}".format(value)) \ No newline at end of file diff --git a/easygui/boxes/demo.py b/demos/demo.py similarity index 90% rename from easygui/boxes/demo.py rename to demos/demo.py index 30a0680..d8e0e9f 100644 --- a/easygui/boxes/demo.py +++ b/demos/demo.py @@ -8,37 +8,22 @@ import os import sys +from tkinter import TkVersion + +from easygui import ROOT_DIR, diropenbox, fileopenbox, filesavebox, buttonbox, ynbox, ccbox, boolbox, indexbox, msgbox, \ + version +from easygui.text_box import textbox, codebox, exceptionbox +from easygui.multi_fillable_box import multenterbox +from easygui.multi_fillable_box import multpasswordbox + +from easygui.fillable_box import integerbox +from easygui.fillable_box import enterbox +from easygui.fillable_box import passwordbox + +from easygui.choice_box import choicebox +from easygui.choice_box import multchoicebox + -try: - from . import utils as ut - from .button_box import buttonbox - from .text_box import textbox - from .diropen_box import diropenbox - from .fileopen_box import fileopenbox - from .filesave_box import filesavebox - from .multi_fillable_box import multenterbox - from .multi_fillable_box import multpasswordbox - - from .derived_boxes import ynbox - from .derived_boxes import ccbox - from .derived_boxes import boolbox - from .derived_boxes import indexbox - from .derived_boxes import msgbox - from .derived_boxes import integerbox - from .derived_boxes import enterbox - from .derived_boxes import exceptionbox - from .derived_boxes import codebox - from .derived_boxes import passwordbox - - from .choice_box import choicebox - from .choice_box import multchoicebox - - from . import about - from .about import eg_version - from .about import abouteasygui -except (SystemError, ValueError, ImportError): - print("Please run demo.py from outside the package") - exit() # -------------------------------------------------------------- # # test/demo easygui @@ -82,7 +67,6 @@ def __init__(self): ("fileopenbox", demo_fileopenbox), ("diropenbox", demo_diropenbox), ("exceptionbox", demo_exceptionbox), - ("About EasyGui", demo_about), ("Help", demo_help), ] @@ -115,10 +99,10 @@ def easygui_demo(): msg = [] msg.append("Pick the kind of box that you wish to demo.") msg.append(" * Python version {}".format(sys.version)) - msg.append(" * EasyGui version {}".format(eg_version)) - msg.append(" * Tk version {}".format(ut.TkVersion)) + msg.append(" * EasyGui version {}".format(version)) + msg.append(" * Tk version {}".format(TkVersion)) intro_message = "\n".join(msg) - title = "EasyGui " + eg_version + title = "EasyGui " + version # Table that relates keys in choicebox with functions to execute descriptions = demos.list_descriptions() preselected = 0 @@ -272,12 +256,6 @@ def demo_integerbox(): return reply -def demo_about(): - reply = abouteasygui() - print("Reply was: {!r}".format(reply)) - return reply - - def demo_enterbox(): image = os.path.join(package_dir, "python_and_check_logo.gif") message = ("Enter the name of your best friend." @@ -379,7 +357,8 @@ def demo_passwordbox(): def demo_help(): - codebox("EasyGui Help", text=about.EASYGUI_ABOUT_INFORMATION) + with open(os.path.join(ROOT_DIR, "HISTORY.rst")) as f: + codebox("EasyGui Help", text=f.read()) return None diff --git a/demos/demo_multi_fillable_box.py b/demos/demo_multi_fillable_box.py new file mode 100644 index 0000000..a91e157 --- /dev/null +++ b/demos/demo_multi_fillable_box.py @@ -0,0 +1,66 @@ +from easygui import multenterbox + + +def demo1(): + msg = "Enter your personal information" + title = "Credit Card Application" + fieldNames = ["Name", "Street Address", "City", "State", "ZipCode"] + fieldValues = [] # we start with blanks for the values + + # make sure that none of the fields was left blank + while True: + + fieldValues = multenterbox(msg, title, fieldNames, fieldValues) + cancelled = fieldValues is None + errors = [] + if cancelled: + pass + else: # check for errors + for name, value in zip(fieldNames, fieldValues): + if value.strip() == "": + errors.append('"{}" is a required field.'.format(name)) + + all_ok = not errors + + if cancelled or all_ok: + break # no problems found + + msg = "\n".join(errors) + + print("Reply was: {}".format(fieldValues)) + + +class Demo2(): + + def __init__(self): + msg = "Without flicker. Enter your personal information" + title = "Credit Card Application" + fieldNames = ["Name", "Street Address", "City", "State", "ZipCode"] + fieldValues = [] # we start with blanks for the values + + fieldValues = multenterbox(msg, title, fieldNames, fieldValues, + callback=self.check_for_blank_fields) + print("Reply was: {}".format(fieldValues)) + + def check_for_blank_fields(self, box): + # make sure that none of the fields was left blank + cancelled = box.values is None + errors = [] + if cancelled: + pass + else: # check for errors + for name, value in zip(box.fields, box.values): + if value.strip() == "": + errors.append('"{}" is a required field.'.format(name)) + + all_ok = not errors + + if cancelled or all_ok: + box.stop() # no problems found + + box.msg = "\n".join(errors) + + +if __name__ == '__main__': + demo1() + Demo2() \ No newline at end of file diff --git a/demos/demo_text_box.py b/demos/demo_text_box.py new file mode 100644 index 0000000..746cff7 --- /dev/null +++ b/demos/demo_text_box.py @@ -0,0 +1,131 @@ +from easygui import textbox + +def demo_1(): + + title = "Demo of textbox: Classic box" + + gnexp = ("This is a demo of the classic textbox call, " + "you can see it closes when ok is pressed.\n\n") + + challenge = "INSERT A TEXT WITH MORE THAN TWO PARAGRAPHS" + + text = "Insert your text here\n" + + msg = gnexp + challenge + + finished = False + while True: + + text = textbox(msg, title, text) + escaped = not text + if escaped or finished: + break + + if text.count("\n") >= 2: + msg = (u"You did it right! Press OK") + finished = True + else: + msg = u"You did it wrong! Try again!\n" + challenge + + +class Demo2(object): + + """ Program that challenges the user to write 5 a's """ + + def __init__(self): + """ Set and run the program """ + + title = "Demo of textbox: Classic box with callback" + + gnexp = ("This is a demo of the textbox with a callback, " + "it doesn't flicker!.\n\n") + + msg = "INSERT A TEXT WITH FIVE OR MORE A\'s" + + text_snippet = "Insert your text here" + + self.finished = False + + textbox(gnexp + msg, title, text_snippet, False, + callback=self.check_answer, run=True) + + def check_answer(self, box): + """ Callback from TextBox + + Parameters + ----------- + box: object + object containing parameters and methods to communicate with the ui + + Returns + ------- + nothing: + its return is through the box object + """ + + if self.finished: + box.stop() + + if box.text.lower().count("a") >= 5: + box.msg = u"\n\nYou did it right! Press OK button to continue." + box.stop() + self.finished + else: + box.msg = u"\n\nMore a's are needed!" + + +class Demo3(object): + + """ Program that challenges the user to find a typo """ + + def __init__(self): + """ Set and run the program """ + + self.finished = False + + title = "Demo of textbox: Object with callback" + + msg = ("This is a demo of the textbox set as " + "an object with a callback, " + "you can configure it and when you are finished, " + "you run it.\n\nThere is a typo in it. Find and correct it.") + + text_snippet = "Hello" # This text wont show + + box = textbox( + msg, title, text_snippet, False, callback=self.check_answer, run=False) + + box.text = ( + "It was the west of times, and it was the worst of times. " + "The rich ate cake, and the poor had cake recommended to them, " + "but wished only for enough cash to buy bread." + "The time was ripe for revolution! ") + + box.run() + + def check_answer(self, box): + """ Callback from TextBox + + Parameters + ---------- + box: object + object containing parameters and methods to communicate with the ui + + Returns + ------- + nothing: + its return is through the box object + """ + if self.finished: + box.stop() + + if "best" in box.text: + box.msg = u"\n\nYou did right! Press OK button to continue." + self.finished = True + else: + box.msg = u"\n\nLook to the west!" + +if __name__ == '__main__': + demo_1() + Demo2() + Demo3() \ No newline at end of file diff --git a/test_cases/dice.py b/demos/dice.py similarity index 92% rename from test_cases/dice.py rename to demos/dice.py index dca5ecf..ad7822c 100644 --- a/test_cases/dice.py +++ b/demos/dice.py @@ -1,4 +1,7 @@ __author__ = 'Robert' + +import easygui.button_box + """ from: http://stackoverflow.com/questions/20317314/python-function-in-a-while-loop-ruining-it-for-me @@ -24,7 +27,7 @@ def get_user_input(target_value, dice_rolls): choices = dice_choices else: choices = operator_choices - var = eg.indexbox(''.join(raw_user_input), "Target value: {}".format(target_value), choices) + var = easygui.button_box.indexbox(''.join(raw_user_input), "Target value: {}".format(target_value), choices) if var is None: raise ValueError("Dialog closed with invalid entry") choice = choices[var] diff --git a/test_cases/flash_multiple_rb.py b/demos/flash_multiple_rb.py similarity index 80% rename from test_cases/flash_multiple_rb.py rename to demos/flash_multiple_rb.py index f9da794..1aae19c 100644 --- a/test_cases/flash_multiple_rb.py +++ b/demos/flash_multiple_rb.py @@ -1,5 +1,7 @@ import sys +import easygui.button_box + sys.path.append('..') import easygui @@ -7,7 +9,7 @@ choices = ["on", "off", "forward", "backward", "right", "left"] inp = '' while inp != "None": #happens when the user presses ESC - inp = easygui.buttonbox("controller","robot", choices) + inp = easygui.button_box.buttonbox("controller", "robot", choices) if inp == "forward": pass elif inp == "backward": diff --git a/test_cases/geo_quiz.py b/demos/geo_quiz.py similarity index 100% rename from test_cases/geo_quiz.py rename to demos/geo_quiz.py diff --git a/test_cases/gps_auto_update.py b/demos/gps_auto_update.py similarity index 100% rename from test_cases/gps_auto_update.py rename to demos/gps_auto_update.py diff --git a/test_cases/hex_entry.py b/demos/hex_entry.py similarity index 100% rename from test_cases/hex_entry.py rename to demos/hex_entry.py diff --git a/test_cases/images/cross.gif b/demos/images/cross.gif similarity index 100% rename from test_cases/images/cross.gif rename to demos/images/cross.gif diff --git a/test_cases/images/daffy duck.gif b/demos/images/daffy duck.gif similarity index 100% rename from test_cases/images/daffy duck.gif rename to demos/images/daffy duck.gif diff --git a/test_cases/images/dave.gif b/demos/images/dave.gif similarity index 100% rename from test_cases/images/dave.gif rename to demos/images/dave.gif diff --git a/test_cases/images/globe.jpg b/demos/images/globe.jpg similarity index 100% rename from test_cases/images/globe.jpg rename to demos/images/globe.jpg diff --git a/test_cases/images/mickey.gif b/demos/images/mickey.gif similarity index 100% rename from test_cases/images/mickey.gif rename to demos/images/mickey.gif diff --git a/test_cases/images/minnie.gif b/demos/images/minnie.gif similarity index 100% rename from test_cases/images/minnie.gif rename to demos/images/minnie.gif diff --git a/easygui/python_and_check_logo.gif b/demos/images/python_and_check_logo.gif similarity index 100% rename from easygui/python_and_check_logo.gif rename to demos/images/python_and_check_logo.gif diff --git a/easygui/python_and_check_logo.jpg b/demos/images/python_and_check_logo.jpg similarity index 100% rename from easygui/python_and_check_logo.jpg rename to demos/images/python_and_check_logo.jpg diff --git a/easygui/python_and_check_logo.png b/demos/images/python_and_check_logo.png similarity index 100% rename from easygui/python_and_check_logo.png rename to demos/images/python_and_check_logo.png diff --git a/test_cases/images/tick.gif b/demos/images/tick.gif similarity index 100% rename from test_cases/images/tick.gif rename to demos/images/tick.gif diff --git a/easygui/zzzzz.gif b/demos/images/zzzzz.gif similarity index 100% rename from easygui/zzzzz.gif rename to demos/images/zzzzz.gif diff --git a/test_cases/multienter_backspace.py b/demos/multienter_backspace.py similarity index 100% rename from test_cases/multienter_backspace.py rename to demos/multienter_backspace.py diff --git a/test_cases/multiple_disney_images.py b/demos/multiple_disney_images.py similarity index 68% rename from test_cases/multiple_disney_images.py rename to demos/multiple_disney_images.py index a6a34be..cdd93c1 100644 --- a/test_cases/multiple_disney_images.py +++ b/demos/multiple_disney_images.py @@ -9,11 +9,13 @@ import sys +import easygui.button_box + sys.path.append('..') import easygui as eg # A welcome message -reply = eg.msgbox("Welcome to the quiz", "Quiz!") +reply = easygui.button_box.msgbox("Welcome to the quiz", "Quiz!") if reply is None: exit() @@ -26,14 +28,14 @@ images.append('images/dave.gif') image = "mickey.gif" choices = ["Mickey", "Minnie", "Daffy Duck", "Dave"] - reply = eg.buttonbox("Click on mickey:", images=images, choices=['Cancel']) + reply = easygui.button_box.buttonbox("Click on mickey:", images=images, choices=['Cancel']) print(reply) if reply is None or reply=='Cancel': break if reply == images[0]: - eg.msgbox("Well done!", "Correct") + easygui.button_box.msgbox("Well done!", "Correct") break else: - eg.msgbox("Wrong", "Failure") + easygui.button_box.msgbox("Wrong", "Failure") diff --git a/test_cases/pi.jpg b/demos/pi.jpg similarity index 100% rename from test_cases/pi.jpg rename to demos/pi.jpg diff --git a/test_cases/result.png b/demos/result.png similarity index 100% rename from test_cases/result.png rename to demos/result.png diff --git a/test_cases/text2binary.py b/demos/text2binary.py similarity index 94% rename from test_cases/text2binary.py rename to demos/text2binary.py index 1a5f277..f582a96 100644 --- a/test_cases/text2binary.py +++ b/demos/text2binary.py @@ -8,5 +8,5 @@ sys.path.append('..') import easygui -Plain = easygui.textbox(msg='Enter Message', title='OTP', text=u'Hi', codebox=1) +Plain = easygui.textbox(msg='Enter Message', title='OTP', text=u'Hi') print(repr(Plain)) #If there is no trailing newline, its OK \ No newline at end of file diff --git a/test_cases/xml_parse.py b/demos/xml_parse.py similarity index 90% rename from test_cases/xml_parse.py rename to demos/xml_parse.py index badb225..4bfcb16 100644 --- a/test_cases/xml_parse.py +++ b/demos/xml_parse.py @@ -1,4 +1,7 @@ __author__ = 'Robert' + +import easygui.button_box + """ from: http://stackoverflow.com/questions/27003762/python-displaying-variable-with-multiple-xml-tags-inside-message-box @@ -29,4 +32,4 @@ books.append('{0} | {1} | {2}'.format(item_name, item_desc, item_status)) # Create message box to display print_xml. - eg.msgbox('\n'.join(books), title="XML Reader") \ No newline at end of file + easygui.button_box.msgbox('\n'.join(books), title="XML Reader") \ No newline at end of file diff --git a/developer_information/BUILD INSTRUCTIONS.txt b/developer_information/BUILD INSTRUCTIONS.txt deleted file mode 100644 index 3f934be..0000000 --- a/developer_information/BUILD INSTRUCTIONS.txt +++ /dev/null @@ -1,95 +0,0 @@ -Introduction: -------------- - -These instructions explain how to actually deploy easygui - -Documentation -------------- -Documentation is auto-built by readthedocs. - -Creating a package ------------------- -* Update README.md and README.txt to include the current release note text -* Update sphinx/conf.py with new version and release date -* Update easygui/easygui.py with new version in eg_version. This should be fixed. -* Update setup.py with new version. update it with any new packages (such as easygui.boxes) -* Update sourceforge site - - -Creating a pypi package ------------------------ - -Links: -Install/packaging: - https://packaging.python.org/en/latest/distributing.html - http://stackoverflow.com/questions/22051360/a-simple-hello-world-setuptools-package-and-installing-it-with-pip - https://hynek.me/articles/sharing-your-labor-of-love-pypi-quick-and-dirty/ -Things I needed to do: -install meld diff tool -pip install --upgrade pip -pip install -U twine -pip install -U wheel -pip install --upgrade virtualenv - -to package it up: -python setup.py sdist -d releases\0.97.4 --formats=gztar,zip -python setup.py bdist_wheel -d releases\0.97.4 - -to package it into an egg: -python setup.py bdist_egg -...but to actually import it (instead of install), I need to change its filename to remove the - - -to tag GitHub repository -git push --tags -git fetch --tags -git tag -a ... -git push --tags - - -- These create two directories: build and dist - -check confirm install works: -virtualenv 27_dist -.\Scripts\activate.bat -then: pip install ...releases..zipfile... -python - import easygui - easygui.egdemo() - - - -To upload to pypi: - -twine upload releases\0.97.4\* - - -Create a .pypirc file in my Users/rlugg (home) directory. The file like: -[distutils] -index-servers= - test-server - pypi - -[test-server] -repository = https://testpypi.python.org/pypi -username = Robert.Lugg -password = XXX - -[pypi] -repository = https://pypi.python.org/pypi -username = Robert.Lugg -password = XXX - -Then: -python setup.py register -r test-server -python setup.py sdist upload -r test-server -python setup.py bdist_wheel upload -r test-server - -xxxxxxxxxxxxxxxxxxxxxxxxxxx -OLD INFO: Not needed. -* Update sourceforge website with 'documentation' directory - sftp: web.sourceforge.net - user: robertlugg (for example) - password: your sourceforge password -* Update pypi docs website: You can now host documentation at http://pythonhosted.org/easygui. To upload documentation, prepare a .zip file that is unpacked into this URL. Only static pages are supported. The zip file must have a top-level "index.html". ------ -# python setup-docs.py sdist -d releases\0.9.3 --formats=gztar,zip # FOR NOW, use 7-zip to create a .tar file diff --git a/developer_information/DEVELOPER_NOTES.txt b/developer_information/DEVELOPER_NOTES.txt deleted file mode 100644 index d99050d..0000000 --- a/developer_information/DEVELOPER_NOTES.txt +++ /dev/null @@ -1,17 +0,0 @@ -Getting Linux up and running. - -Use virtualbox and download a ready-made vdi file for something like experimentalOS - - - - -Setup up git to use meld as default -git config --global merge.tool meld - -Issues with ElementaryOS0.2. I needed, for some reason to install this: -sudo apt-get install python-tk - -Git Stuff: -* We will follow the process described in Git-branching-model.pdf -* To remove a file from Git, but still leave it in the local directory: git rm --cached file.txt -* Tag files when released: $ git tag -a "0.97.3" -m "0.97.3 (2014-12-27)" diff --git a/developer_information/Git-branching-model.png b/developer_information/Git-branching-model.png deleted file mode 100644 index bb110b7..0000000 Binary files a/developer_information/Git-branching-model.png and /dev/null differ diff --git a/easygui/__init__.py b/easygui/__init__.py index 4b2c716..811f758 100644 --- a/easygui/__init__.py +++ b/easygui/__init__.py @@ -1,58 +1,37 @@ """ -Hello from easygui/__init__.py +easygui/__init__.py + +__all__ must be defined in order for Sphinx to generate the API automatically. """ -# __all__ must be defined in order for Sphinx to generate the API automatically. -__all__ = ['buttonbox', - 'diropenbox', - 'fileopenbox', - 'filesavebox', - 'textbox', - 'ynbox', - 'ccbox', - 'boolbox', - 'indexbox', - 'msgbox', - 'integerbox', - 'multenterbox', - 'enterbox', - 'exceptionbox', - 'choicebox', - 'codebox', - 'passwordbox', - 'multpasswordbox', - 'multchoicebox', - 'EgStore', - 'eg_version', - 'egversion', - 'abouteasygui', - 'egdemo', +__all__ = [ + # boxes using the ButtonBox class + "buttonbox", "msgbox", "boolbox", "ynbox", "ccbox", "indexbox", + # boxes using the ChoiceBox class + "choicebox", "multchoicebox", + # filedialog boxes that directly use existing tkinter implementation + "fileopenbox", "filesavebox", "diropenbox", + # boxes using the FillableBox class + "fillablebox", "enterbox", "passwordbox", "integerbox", + # boxes using the MultiBox class + "multenterbox", "multpasswordbox", + # boxes using the TextBox class + "textbox", "codebox", "exceptionbox", + # errata + 'EgStore', 'version' ] -# Import all functions that form the API -from .boxes.button_box import buttonbox -from .boxes.diropen_box import diropenbox -from .boxes.fileopen_box import fileopenbox -from .boxes.filesave_box import filesavebox - -from .boxes.text_box import textbox +from .button_box import buttonbox, msgbox, boolbox, ynbox, ccbox, indexbox +from .choice_box import choicebox, multchoicebox +from .egstore import EgStore +from .file_boxes import fileopenbox, filesavebox, diropenbox +from .fillable_box import fillablebox, enterbox, passwordbox, integerbox +from .multi_fillable_box import multenterbox, multpasswordbox +from .text_box import textbox, codebox, exceptionbox +import tkinter as tk # python 3 -from .boxes.derived_boxes import ynbox -from .boxes.derived_boxes import ccbox -from .boxes.derived_boxes import boolbox -from .boxes.derived_boxes import indexbox -from .boxes.derived_boxes import msgbox -from .boxes.derived_boxes import integerbox -from .boxes.multi_fillable_box import multenterbox -from .boxes.derived_boxes import enterbox -from .boxes.derived_boxes import exceptionbox -from .boxes.choice_box import choicebox -from .boxes.derived_boxes import codebox -from .boxes.derived_boxes import passwordbox -from .boxes.multi_fillable_box import multpasswordbox -from .boxes.choice_box import multchoicebox -from .boxes.egstore import EgStore, read_or_create_settings -from .boxes.about import eg_version, egversion, abouteasygui -from .boxes.demo import easygui_demo as egdemo +import os +ROOT_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) +version = "0.98.3" \ No newline at end of file diff --git a/easygui/__main__.py b/easygui/__main__.py deleted file mode 100644 index 6705118..0000000 --- a/easygui/__main__.py +++ /dev/null @@ -1,2 +0,0 @@ -from .boxes.demo import easygui_demo -easygui_demo() \ No newline at end of file diff --git a/easygui/boxes/base_boxes.py b/easygui/boxes/base_boxes.py index 7bc67d4..e69de29 100644 --- a/easygui/boxes/base_boxes.py +++ b/easygui/boxes/base_boxes.py @@ -1,27 +0,0 @@ -""" - -.. moduleauthor:: easygui developers and Stephen Raymond Ferg -.. default-domain:: py -.. highlight:: python - -Version |release| -""" - -boxRoot = None - - -def bindArrows(widget): - - widget.bind("", tabRight) - widget.bind("", tabLeft) - - widget.bind("", tabRight) - widget.bind("", tabLeft) - - -def tabRight(event): - boxRoot.event_generate("") - - -def tabLeft(event): - boxRoot.event_generate("") diff --git a/easygui/boxes/button_box.py b/easygui/boxes/button_box.py deleted file mode 100644 index 53545ac..0000000 --- a/easygui/boxes/button_box.py +++ /dev/null @@ -1,507 +0,0 @@ -""" - -.. moduleauthor:: easygui developers and Stephen Raymond Ferg -.. default-domain:: py -.. highlight:: python - -Version |release| -""" - -import os -import re - -try: - from . import global_state - from . import utils as ut - from .text_box import textbox -except (SystemError, ValueError, ImportError): - import global_state - import utils as ut - from text_box import textbox - -try: - import tkinter as tk # python 3 - import tkinter.font as tk_Font -except (SystemError, ValueError, ImportError): - import Tkinter as tk # python 2 - import tkFont as tk_Font - - -def demo_buttonbox_1(): - print("hello from the demo") - value = buttonbox( - title="First demo", - msg="bonjour", - choices=["Button[1]", "Button[2]", "Button[3]"], - default_choice="Button[2]") - print("Return: {}".format(value)) - - -def demo_buttonbox_2(): - package_dir = os.path.dirname(os.path.dirname(os.path.realpath(__file__))) ;# My parent's directory - images = list() - images.append(os.path.join(package_dir, "python_and_check_logo.gif")) - images.append(os.path.join(package_dir, "zzzzz.gif")) - images.append(os.path.join(package_dir, "python_and_check_logo.png")) - images = [images, images, images, images, ] - value = buttonbox( - title="Second demo", - msg="Now is a good time to press buttons and show images", - choices=['ok', 'cancel'], - images=images) - print("Return: {}".format(value)) - -# REF: http://stackoverflow.com/questions/1835018/python-check-if-an-object-is-a-list-or-tuple-but-not-string -def is_sequence(arg): - return hasattr(arg, "__getitem__") or hasattr(arg, "__iter__") - -def is_string(arg): - ret_val = None - try: - ret_val = isinstance(arg, basestring) #Python 2 - except: - ret_val = isinstance(arg, str) #Python 3 - return ret_val - -def buttonbox(msg="", - title=" ", - choices=("Button[1]", "Button[2]", "Button[3]"), - image=None, - images=None, - default_choice=None, - cancel_choice=None, - callback=None, - run=True): - """ - Display a message, a title, an image, and a set of buttons. - The buttons are defined by the members of the choices argument. - - :param str msg: the msg to be displayed - :param str title: the window title - :param list choices: a list or tuple of the choices to be displayed - :param str image: (Only here for backward compatibility) - :param str images: Filename of image or iterable or iteratable of iterable to display - :param str default_choice: The choice you want highlighted when the gui appears - :return: the text of the button that the user selected - - - - """ - - if image and images: - raise ValueError("Specify 'images' parameter only for buttonbox.") - if image: - images = image - bb = ButtonBox( - msg=msg, - title=title, - choices=choices, - images=images, - default_choice=default_choice, - cancel_choice=cancel_choice, - callback=callback) - if not run: - return bb - else: - reply = bb.run() - return reply - - -class ButtonBox(object): - """ Display various types of button boxes - - This object separates user from ui, defines which methods can - the user invoke and which properties can he change. - - It also calls the ui in defined ways, so if other gui - library can be used (wx, qt) without breaking anything for the user. - """ - - def __init__(self, msg, title, choices, images, default_choice, cancel_choice, callback): - """ Create box object - - Parameters - ---------- - msg : string - text displayed in the message area (instructions...) - title : str - the window title - choices : iterable of strings - build a button for each string in choices - images : iterable of filenames, or an iterable of iterables of filenames - displays each image - default_choice : string - one of the strings in choices to be the default selection - cancel_choice : string - if X or is pressed, it appears as if this button was pressed. - callback: function - if set, this function will be called when any button is pressed. - - Returns - ------- - object - The box object - """ - - self.callback = callback - self.ui = GUItk(msg, title, choices, images, default_choice, cancel_choice, self.callback_ui) - - def run(self): - """ Start the ui """ - self.ui.run() - ret_val = self._text - self.ui = None - return ret_val - - def stop(self): - """ Stop the ui """ - self.ui.stop() - - def callback_ui(self, ui, command): - """ This method is executed when buttons or x is pressed in the ui. - """ - if command == 'update': # Any button was pressed - self._text = ui.choice - self._choice_rc = ui.choice_rc - if self.callback: - # If a callback was set, call main process - self.callback(self) - else: - self.stop() - elif command == 'x': - self.stop() - self._text = None - elif command == 'cancel': - self.stop() - self._text = None - - # methods to change properties -------------- - @property - def msg(self): - """Text in msg Area""" - return self._msg - - @msg.setter - def msg(self, msg): - self._msg = self.to_string(msg) - self.ui.set_msg(self._msg) - - @msg.deleter - def msg(self): - self._msg = "" - self.ui.set_msg(self._msg) - - @property - def choice(self): - """ Name of button selected """ - return self._text - - @property - def choice_rc(self): - """ The row/column of the selected button (as a tuple) """ - return self._choice_rc - - # Methods to validate what will be sent to ui --------- - - def to_string(self, something): - try: - basestring # python 2 - except NameError: - basestring = str # Python 3 - - if isinstance(something, basestring): - return something - try: - text = "".join(something) # convert a list or a tuple to a string - except: - textbox( - "Exception when trying to convert {} to text in self.textArea" - .format(type(something))) - sys.exit(16) - return text - - -class GUItk(object): - """ This is the object that contains the tk root object""" - - def __init__(self, msg, title, choices, images, default_choice, cancel_choice, callback): - """ Create ui object - - Parameters - ---------- - msg : string - text displayed in the message area (instructions...) - title : str - the window title - choices : iterable of strings - build a button for each string in choices - images : iterable of filenames, or an iterable of iterables of filenames - displays each image - default_choice : string - one of the strings in choices to be the default selection - cancel_choice : string - if X or is pressed, it appears as if this button was pressed. - callback: function - if set, this function will be called when any button is pressed. - - - Returns - ------- - object - The ui object - """ - self._title = title - self._msg = msg - self._choices = choices - self._default_choice = default_choice - self._cancel_choice = cancel_choice - self.callback = callback - self._choice_text = None - self._choice_rc = None - self._images = list() - - self.boxRoot = tk.Tk() - # self.boxFont = tk_Font.Font( - # family=global_state.PROPORTIONAL_FONT_FAMILY, - # size=global_state.PROPORTIONAL_FONT_SIZE) - - self.boxFont = tk_Font.nametofont("TkFixedFont") - self.width_in_chars = global_state.fixw_font_line_length - - # default_font.configure(size=global_state.PROPORTIONAL_FONT_SIZE) - - self.configure_root(title) - - self.create_msg_widget(msg) - - self.create_images_frame() - - self.create_images(images) - - self.create_buttons_frame() - - self.create_buttons(choices, default_choice) - - - @property - def choice(self): - return self._choice_text - - @property - def choice_rc(self): - return self._choice_rc - - # Run and stop methods --------------------------------------- - - def run(self): - self.boxRoot.mainloop() - self.boxRoot.destroy() - - def stop(self): - # Get the current position before quitting - #self.get_pos() - self.boxRoot.quit() - - # Methods to change content --------------------------------------- - def set_msg(self, msg): - self.messageArea.config(state=tk.NORMAL) - self.messageArea.delete(1.0, tk.END) - self.messageArea.insert(tk.END, msg) - self.messageArea.config(state=tk.DISABLED) - # Adjust msg height - self.messageArea.update() - self.set_msg_height() - self.messageArea.update() - - def set_msg_height(self): - message_content = self.messageArea.get("1.0", tk.END) - lines = message_content.split("\n") - width = self.messageArea["width"] - num_lines = len(lines) - num_wordwraps = sum(len(line) // width for line in lines if len(line) != width) - height = num_lines + num_wordwraps + 1 - self.messageArea.configure(height=height) - - def set_pos(self, pos): - self.boxRoot.geometry(pos) - - def get_pos(self): - # The geometry() method sets a size for the window and positions it on - # the screen. The first two parameters are width and height of - # the window. The last two parameters are x and y screen coordinates. - # geometry("250x150+300+300") - geom = self.boxRoot.geometry() # "628x672+300+200" - global_state.window_position = '+' + geom.split('+', 1)[1] - - # Methods executing when a key is pressed ------------------------------- - def x_pressed(self): - self._choice_text = self._cancel_choice - self.callback(self, command='x') - - def cancel_pressed(self, event): - self._choice_text = self._cancel_choice - self.callback(self, command='cancel') - - def button_pressed(self, button_text, button_rc): - self._choice_text = button_text - self._choice_rc = button_rc - self.callback(self, command='update') - - def hotkey_pressed(self, event=None): - """ - Handle an event that is generated by a person interacting with a button. It may be a button press - or a key press. - - TODO: Enhancement: Allow hotkey to be specified in filename of image as a shortcut too!!! - """ - - # Determine window location and save to global - # TODO: Not sure where this goes, but move it out of here! - m = re.match(r"(\d+)x(\d+)([-+]\d+)([-+]\d+)", self.boxRoot.geometry()) - if not m: - raise ValueError( - "failed to parse geometry string: {}".format(self.boxRoot.geometry())) - width, height, xoffset, yoffset = [int(s) for s in m.groups()] - global_state.window_position = '{0:+g}{1:+g}'.format(xoffset, yoffset) - - # Hotkeys - if self._buttons: - for button_name, button in self._buttons.items(): - hotkey_pressed = event.keysym - if event.keysym != event.char: # A special character - hotkey_pressed = '<{}>'.format(event.keysym) - if button['hotkey'] == hotkey_pressed: - self._choice_text = button_name - self.callback(self, command='update') - return - print("Event not understood") - - # Auxiliary methods ----------------------------------------------- - def calc_character_width(self): - char_width = self.boxFont.measure('W') - return char_width - - # Initial configuration methods --------------------------------------- - # These ones are just called once, at setting. - - def configure_root(self, title): - self.boxRoot.title(title) - - self.set_pos(global_state.window_position) - - # Resize setup - self.boxRoot.columnconfigure(0, weight=10) - self.boxRoot.minsize(100, 200) - # Quit when x button pressed - self.boxRoot.protocol('WM_DELETE_WINDOW', self.x_pressed) - self.boxRoot.bind("", self.cancel_pressed) - self.boxRoot.iconname('Dialog') - self.boxRoot.attributes("-topmost", True) # Put the dialog box in focus. - - def create_msg_widget(self, msg): - - if msg is None: - msg = "" - - self.messageArea = tk.Text( - self.boxRoot, - width=self.width_in_chars, - state=tk.DISABLED, - padx=(global_state.default_hpad_in_chars) * - self.calc_character_width(), - relief="flat", - background=self.boxRoot.config()["background"][-1], - pady=global_state.default_hpad_in_chars * - self.calc_character_width(), - wrap=tk.WORD, - ) - self.set_msg(msg) - self.messageArea.grid(row=0) - self.boxRoot.rowconfigure(0, weight=10, minsize='10m') - - def create_images_frame(self): - self.imagesFrame = tk.Frame(self.boxRoot) - row = 1 - self.imagesFrame.grid(row=row) - self.boxRoot.rowconfigure(row, weight=10, minsize='10m') - - def create_images(self, filenames): - """ - Create one or more images in the dialog. - :param filenames: - May be a filename (which will generate a single image), a list of filenames (which will generate - a row of images), or a list of list of filename (which will create a 2D array of buttons. - :return: - """ - if filenames is None: - return - # Convert to a list of lists of filenames regardless of input - if is_string(filenames): - filenames = [[filenames,],] - elif is_sequence(filenames) and is_string(filenames[0]): - filenames = [filenames,] - elif is_sequence(filenames) and is_sequence(filenames[0]) and is_string(filenames[0][0]): - pass - else: - raise ValueError("Incorrect images argument.") - - images = list() - for _r, images_row in enumerate(filenames): - row_number = len(filenames) - _r - for column_number, filename in enumerate(images_row): - this_image = dict() - try: - this_image['tk_image'] = ut.load_tk_image(filename) - except Exception as e: - print(e) - this_image['tk_image'] = None - this_image['widget'] = tk.Button( - self.imagesFrame, - takefocus=1, - compound=tk.TOP) - if this_image['widget'] is not None: - this_image['widget'].configure(image=this_image['tk_image']) - fn = lambda text=filename, row=_r, column=column_number: self.button_pressed(text, (row, column)) - this_image['widget'].configure(command=fn) - sticky_dir = tk.N+tk.S+tk.E+tk.W - this_image['widget'].grid(row=row_number, column=column_number, sticky=sticky_dir, padx='1m', pady='1m', ipadx='2m', ipady='1m') - self.imagesFrame.rowconfigure(row_number, weight=10, minsize='10m') - self.imagesFrame.columnconfigure(column_number, weight=10) - images.append(this_image) - self._images = images # Image objects must live, so place them in self. Otherwise, they will be deleted. - - def create_buttons_frame(self): - self.buttonsFrame = tk.Frame(self.boxRoot) - self.buttonsFrame.grid(row=2, column=0) - - def create_buttons(self, choices, default_choice): - unique_choices = ut.uniquify_list_of_strings(choices) - # Create buttons dictionary and Tkinter widgets - buttons = dict() - i_hack = 0 - for row, (button_text, unique_button_text) in enumerate(zip(choices, unique_choices)): - this_button = dict() - this_button['original_text'] = button_text - this_button['clean_text'], this_button['hotkey'], hotkey_position = ut.parse_hotkey(button_text) - this_button['widget'] = tk.Button( - self.buttonsFrame, - takefocus=1, - text=this_button['clean_text'], - underline=hotkey_position) - fn = lambda text=button_text, row=row, column=0: self.button_pressed(text, (row, column)) - this_button['widget'].configure(command=fn) - this_button['widget'].grid(row=0, column=i_hack, padx='1m', pady='1m', ipadx='2m', ipady='1m') - self.buttonsFrame.columnconfigure(i_hack, weight=10) - i_hack += 1 - buttons[unique_button_text] = this_button - self._buttons = buttons - if default_choice in buttons: - buttons[default_choice]['widget'].focus_force() - # Bind hotkeys - for hk in [button['hotkey'] for button in buttons.values() if button['hotkey']]: - self.boxRoot.bind_all(hk, lambda e: self.hotkey_pressed(e), add=True) - - -if __name__ == '__main__': - demo_buttonbox_1() - demo_buttonbox_2() \ No newline at end of file diff --git a/easygui/boxes/choice_box.py b/easygui/boxes/choice_box.py index 294906d..e69de29 100644 --- a/easygui/boxes/choice_box.py +++ b/easygui/boxes/choice_box.py @@ -1,530 +0,0 @@ -import string -import sys - -from easygui.boxes.utils import mouse_click_handlers - -if sys.version_info < (3, 10): - from collections import Sequence -else: - from collections.abc import Sequence - -try: - from . import global_state - from .base_boxes import bindArrows -except (SystemError, ValueError, ImportError): - import global_state - from base_boxes import bindArrows - -try: - import tkinter as tk # python 3 - import tkinter.font as tk_Font -except: - import Tkinter as tk # python 2 - import tkFont as tk_Font - - -def choicebox(msg="Pick an item", title="", choices=None, preselect=0, - callback=None, - run=True): - """ - The ``choicebox()`` provides a list of choices in a list box to choose - from. The choices are specified in a sequence (a tuple or a list). - - import easygui - msg ="What is your favorite flavor?" - title = "Ice Cream Survey" - choices = ["Vanilla", "Chocolate", "Strawberry", "Rocky Road"] - choice = easygui.choicebox(msg, title, choices) # choice is a string - - :param str msg: the msg to be displayed - :param str title: the window title - :param list choices: a list or tuple of the choices to be displayed - :param preselect: Which item, if any are preselected when dialog appears - :return: A string of the selected choice or None if cancelled - """ - mb = ChoiceBox(msg, title, choices, preselect=preselect, - multiple_select=False, - callback=callback) - if run: - reply = mb.run() - return reply - else: - return mb - - -def multchoicebox(msg="Pick an item", title="", choices=None, - preselect=0, callback=None, - run=True): - """ - The ``multchoicebox()`` function provides a way for a user to select - from a list of choices. The interface looks just like the ``choicebox()`` - function's dialog box, but the user may select zero, one, or multiple choices. - - The choices are specified in a sequence (a tuple or a list). - - import easygui - msg ="What is your favorite flavor?" - title = "Ice Cream Survey" - choices = ["Vanilla", "Chocolate", "Strawberry", "Rocky Road"] - choice = easygui.multchoicebox(msg, title, choices) - - - :param str msg: the msg to be displayed - :param str title: the window title - :param list choices: a list or tuple of the choices to be displayed - :param preselect: Which item, if any are preselected when dialog appears - :return: A list of strings of the selected choices or None if cancelled. - """ - mb = ChoiceBox(msg, title, choices, preselect=preselect, - multiple_select=True, - callback=callback) - if run: - reply = mb.run() - return reply - else: - return mb - - -# Utility function. But, is it generic enough to be moved out of here? -def make_list_or_none(obj, cast_type=None): - # ------------------------------------------------------------------- - # for an object passed in, put it in standardized form. - # It may be None. Just return None - # If it is a scalar, attempt to cast it into cast_type. Raise error - # if not possible. Convert scalar to a single-element list. - # If it is a collections.Sequence (including a scalar converted to let), - # then cast each element to cast_type. Raise error if any cannot be converted. - # ------------------------------------------------------------------- - ret_val = obj - if ret_val is None: - return None - # Convert any non-sequence to single-element list - if not isinstance(obj, Sequence): - if cast_type is not None: - try: - ret_val = cast_type(obj) - except Exception as e: - raise Exception("Value {} cannot be converted to type: {}".format(obj, cast_type)) - ret_val = [ret_val,] - # Convert all elements to cast_type - if cast_type is not None: - try: - ret_val = [cast_type(elem) for elem in ret_val] - except: - raise Exception("Not all values in {}\n can be converted to type: {}".format(ret_val, cast_type)) - return ret_val - - -class ChoiceBox(object): - - def __init__(self, msg, title, choices, preselect, multiple_select, callback): - - self.callback = callback - - if choices is None: - # Use default choice selections if none were specified: - choices = ('Choice 1', 'Choice 2') - self.choices = self.to_list_of_str(choices) - - # Convert preselect to always be a list or None. - preselect_list = make_list_or_none(preselect, cast_type=int) - if not multiple_select and len(preselect_list)>1: - raise ValueError("Multiple selections not allowed, yet preselect has multiple values:{}".format(preselect_list)) - - self.ui = GUItk(msg, title, self.choices, preselect_list, multiple_select, - self.callback_ui) - - def run(self): - """ Start the ui """ - self.ui.run() - self.ui = None - return self.choices - - def stop(self): - """ Stop the ui """ - self.ui.stop() - - def callback_ui(self, ui, command, choices): - """ This method is executed when ok, cancel, or x is pressed in the ui. - """ - if command == 'update': # OK was pressed - self.choices = choices - if self.callback: - # If a callback was set, call main process - self.callback(self) - else: - self.stop() - elif command == 'x': - self.stop() - self.choices = None - elif command == 'cancel': - self.stop() - self.choices = None - - # methods to change properties -------------- - - @property - def msg(self): - """Text in msg Area""" - return self._msg - - @msg.setter - def msg(self, msg): - self.ui.set_msg(msg) - - @msg.deleter - def msg(self): - self._msg = "" - self.ui.set_msg(self._msg) - - # Methods to validate what will be sent to ui --------- - - def to_list_of_str(self, choices): - choices = [str(c) for c in choices] - - while len(choices) < 2: - raise ValueError('at least two choices need to be specified') - - return choices - - - -class GUItk(object): - - """ This object contains the tk root object. - It draws the window, waits for events and communicates them - to MultiBox, together with the entered values. - - The position in wich it is drawn comes from a global variable. - - It also accepts commands from Multibox to change its message. - """ - - def __init__(self, msg, title, choices, preselect, multiple_select, callback): - - self.callback = callback - - self.choices = choices - - self.width_in_chars = global_state.prop_font_line_length - # Initialize self.selected_choices - # This is the value that will be returned if the user clicks the close - # icon - # self.selected_choices = None - - self.multiple_select = multiple_select - - self.boxRoot = tk.Tk() - - self.boxFont = tk_Font.nametofont("TkTextFont") - - self.config_root(title) - - self.set_pos(global_state.window_position) # GLOBAL POSITION - - self.create_msg_widget(msg) - - self.create_choicearea() - - self.create_ok_button() - - self.create_cancel_button() - - self.create_special_buttons() - - self.preselect_choice(preselect) - - self.choiceboxWidget.focus_force() - - # Run and stop methods --------------------------------------- - - def run(self): - self.boxRoot.mainloop() # run it! - self.boxRoot.destroy() # Close the window - - def stop(self): - # Get the current position before quitting - self.get_pos() - - self.boxRoot.quit() - - def x_pressed(self): - self.callback(self, command='x', choices=self.get_choices()) - - def cancel_pressed(self, event): - self.callback(self, command='cancel', choices=self.get_choices()) - - def ok_pressed(self, event): - self.callback(self, command='update', choices=self.get_choices()) - - # Methods to change content --------------------------------------- - - # Methods to change content --------------------------------------- - - def set_msg(self, msg): - self.messageArea.config(state=tk.NORMAL) - self.messageArea.delete(1.0, tk.END) - self.messageArea.insert(tk.END, msg) - self.messageArea.config(state=tk.DISABLED) - # Adjust msg height - self.messageArea.update() - numlines = self.get_num_lines(self.messageArea) - self.set_msg_height(numlines) - self.messageArea.update() - # put the focus on the entryWidget - - def set_msg_height(self, numlines): - self.messageArea.configure(height=numlines) - - def get_num_lines(self, widget): - end_position = widget.index(tk.END) # '4.0' - end_line = end_position.split('.')[0] # 4 - return int(end_line) + 1 # 5 - - def set_pos(self, pos=None): - if not pos: - pos = global_state.window_position - self.boxRoot.geometry(pos) - - def get_pos(self): - # The geometry() method sets a size for the window and positions it on - # the screen. The first two parameters are width and height of - # the window. The last two parameters are x and y screen coordinates. - # geometry("250x150+300+300") - geom = self.boxRoot.geometry() # "628x672+300+200" - global_state.window_position = '+' + geom.split('+', 1)[1] - - def preselect_choice(self, preselect): - if preselect != None: - for v in preselect: - self.choiceboxWidget.select_set(v) - self.choiceboxWidget.activate(v) - - def get_choices(self): - choices_index = self.choiceboxWidget.curselection() - if not choices_index: - return None - if self.multiple_select: - selected_choices = [self.choiceboxWidget.get(index) - for index in choices_index] - else: - selected_choices = self.choiceboxWidget.get(choices_index) - - return selected_choices - - # Auxiliary methods ----------------------------------------------- - def calc_character_width(self): - char_width = self.boxFont.measure('W') - return char_width - - def config_root(self, title): - - screen_width = self.boxRoot.winfo_screenwidth() - screen_height = self.boxRoot.winfo_screenheight() - self.root_width = int((screen_width * 0.8)) - root_height = int((screen_height * 0.5)) - - self.boxRoot.title(title) - self.boxRoot.iconname('Dialog') - self.boxRoot.expand = tk.NO - # self.boxRoot.minsize(width=62 * self.calc_character_width()) - - self.set_pos() - - self.boxRoot.protocol('WM_DELETE_WINDOW', self.x_pressed) - self.boxRoot.bind('', self.KeyboardListener) - self.boxRoot.bind("", self.cancel_pressed) - - self.boxRoot.attributes("-topmost", True) # Put the dialog box in focus. - - def create_msg_widget(self, msg): - - if msg is None: - msg = "" - - self.msgFrame = tk.Frame( - self.boxRoot, - padx=2 * self.calc_character_width(), - - ) - self.messageArea = tk.Text( - self.msgFrame, - width=self.width_in_chars, - state=tk.DISABLED, - background=self.boxRoot.config()["background"][-1], - relief='flat', - padx=(global_state.default_hpad_in_chars * - self.calc_character_width()), - pady=(global_state.default_hpad_in_chars * - self.calc_character_width()), - wrap=tk.WORD, - - ) - self.set_msg(msg) - - self.msgFrame.pack(side=tk.TOP, expand=1, fill='both') - - self.messageArea.pack(side=tk.TOP, expand=1, fill='both') - - def create_choicearea(self): - - self.choiceboxFrame = tk.Frame(master=self.boxRoot) - self.choiceboxFrame.pack(side=tk.TOP, fill=tk.BOTH, expand=tk.YES) - - lines_to_show = min(len(self.choices), 20) - - # -------- put the self.choiceboxWidget in the self.choiceboxFrame --- - self.choiceboxWidget = tk.Listbox(self.choiceboxFrame, - height=lines_to_show, - borderwidth="1m", relief="flat", - bg="white" - ) - - if self.multiple_select: - self.choiceboxWidget.configure(selectmode=tk.MULTIPLE) - - # self.choiceboxWidget.configure(font=(global_state.PROPORTIONAL_FONT_FAMILY, - # global_state.PROPORTIONAL_FONT_SIZE)) - - # add a vertical scrollbar to the frame - rightScrollbar = tk.Scrollbar(self.choiceboxFrame, orient=tk.VERTICAL, - command=self.choiceboxWidget.yview) - self.choiceboxWidget.configure(yscrollcommand=rightScrollbar.set) - - # add a horizontal scrollbar to the frame - bottomScrollbar = tk.Scrollbar(self.choiceboxFrame, - orient=tk.HORIZONTAL, - command=self.choiceboxWidget.xview) - self.choiceboxWidget.configure(xscrollcommand=bottomScrollbar.set) - - # pack the Listbox and the scrollbars. - # Note that although we must define - # the textArea first, we must pack it last, - # so that the bottomScrollbar will - # be located properly. - - bottomScrollbar.pack(side=tk.BOTTOM, fill=tk.X) - rightScrollbar.pack(side=tk.RIGHT, fill=tk.Y) - - self.choiceboxWidget.pack( - side=tk.LEFT, padx="1m", pady="1m", expand=tk.YES, fill=tk.BOTH) - - # Insert choices widgets - for choice in self.choices: - self.choiceboxWidget.insert(tk.END, choice) - - # Bind the keyboard events - self.choiceboxWidget.bind("", self.ok_pressed) - self.choiceboxWidget.bind("", - self.ok_pressed) - - def create_ok_button(self): - - self.buttonsFrame = tk.Frame(self.boxRoot) - self.buttonsFrame.pack(side=tk.TOP, expand=tk.YES, pady=0) - - # put the buttons in the self.buttonsFrame - okButton = tk.Button(self.buttonsFrame, takefocus=tk.YES, - text="OK", height=1, width=6) - bindArrows(okButton) - okButton.pack(expand=tk.NO, side=tk.RIGHT, padx='2m', pady='1m', - ipady="1m", ipadx="2m") - - # for the commandButton, bind activation events - okButton.bind("", self.ok_pressed) - okButton.bind("", self.ok_pressed) - - mouse_handlers = mouse_click_handlers(self.ok_pressed) - for selectionEvent in global_state.STANDARD_SELECTION_EVENTS_MOUSE: - okButton.bind("<%s>" % selectionEvent, mouse_handlers[selectionEvent]) - - def create_cancel_button(self): - cancelButton = tk.Button(self.buttonsFrame, takefocus=tk.YES, - text="Cancel", height=1, width=6) - bindArrows(cancelButton) - cancelButton.pack(expand=tk.NO, side=tk.LEFT, padx='2m', pady='1m', - ipady="1m", ipadx="2m") - cancelButton.bind("", self.cancel_pressed) - - mouse_handlers = mouse_click_handlers(self.cancel_pressed) - for selectionEvent in global_state.STANDARD_SELECTION_EVENTS_MOUSE: - cancelButton.bind("<%s>" % selectionEvent, mouse_handlers[selectionEvent]) - - def create_special_buttons(self): - # add special buttons for multiple select features - if not self.multiple_select: - return - - selectAllButton = tk.Button( - self.buttonsFrame, text="Select All", height=1, width=6) - selectAllButton.pack(expand=tk.NO, side=tk.LEFT, padx='2m', - pady='1m', - ipady="1m", ipadx="2m") - - clearAllButton = tk.Button(self.buttonsFrame, text="Clear All", - height=1, width=6) - clearAllButton.pack(expand=tk.NO, side=tk.LEFT, - padx='2m', pady='1m', - ipady="1m", ipadx="2m") - - selectAllButton.bind("", self.choiceboxSelectAll) - bindArrows(selectAllButton) - clearAllButton.bind("", self.choiceboxClearAll) - bindArrows(clearAllButton) - - def KeyboardListener(self, event): - key = event.keysym - if len(key) <= 1: - if key in string.printable: - # Find the key in the liglobal_state. - # before we clear the list, remember the selected member - try: - start_n = int(self.choiceboxWidget.curselection()[0]) - except IndexError: - start_n = -1 - - # clear the selection. - self.choiceboxWidget.selection_clear(0, 'end') - - # start from previous selection +1 - for n in range(start_n + 1, len(self.choices)): - item = self.choices[n] - if item[0].lower() == key.lower(): - self.choiceboxWidget.selection_set(first=n) - self.choiceboxWidget.see(n) - return - else: - # has not found it so loop from top - for n, item in enumerate(self.choices): - if item[0].lower() == key.lower(): - self.choiceboxWidget.selection_set(first=n) - self.choiceboxWidget.see(n) - return - - # nothing matched -- we'll look for the next logical choice - for n, item in enumerate(self.choices): - if item[0].lower() > key.lower(): - if n > 0: - self.choiceboxWidget.selection_set( - first=(n - 1)) - else: - self.choiceboxWidget.selection_set(first=0) - self.choiceboxWidget.see(n) - return - - # still no match (nothing was greater than the key) - # we set the selection to the first item in the list - lastIndex = len(self.choices) - 1 - self.choiceboxWidget.selection_set(first=lastIndex) - self.choiceboxWidget.see(lastIndex) - return - - def choiceboxClearAll(self, event): - self.choiceboxWidget.selection_clear(0, len(self.choices) - 1) - - def choiceboxSelectAll(self, event): - self.choiceboxWidget.selection_set(0, len(self.choices) - 1) - -if __name__ == '__main__': - users_choice = multchoicebox(choices=['choice1', 'choice2']) - print("User's choice is: {}".format(users_choice)) diff --git a/easygui/boxes/derived_boxes.py b/easygui/boxes/derived_boxes.py deleted file mode 100644 index e8c92d0..0000000 --- a/easygui/boxes/derived_boxes.py +++ /dev/null @@ -1,428 +0,0 @@ -""" - -.. moduleauthor:: easygui developers and Stephen Raymond Ferg -.. default-domain:: py -.. highlight:: python - -""" - -try: - from .fillable_box import __fillablebox - from .button_box import buttonbox - from . import text_box as tb - from . import utils as ut -except (SystemError, ValueError, ImportError): - from fillable_box import __fillablebox - from button_box import buttonbox - import text_box as tb - import utils as ut - -# ------------------------------------------------------------------- -# various boxes built on top of the basic buttonbox -# ----------------------------------------------------------------------- - -# ----------------------------------------------------------------------- -# ynbox -# ----------------------------------------------------------------------- - - -def ynbox(msg="Shall I continue?", title=" ", - choices=("[]Yes", "[]No"), image=None, - default_choice='[]Yes', cancel_choice='[]No'): - """ - The ``ynbox()`` offers a choice of Yes and No, and returns either ``True`` or ``False``. - - import easygui - result = easygui.ynbox('Is a hot dog a sandwich?', 'Hot Dog Question') - if result == True: - easygui.msgbox('That is an interesting answer.') - else: - easygui.msgbox('Well, that is your opinion.') - - :param msg: the msg to be displayed - :type msg: str - :param str title: the window title - :param list choices: a list or tuple of the choices to be displayed - :param str image: Filename of image to display - :param str default_choice: The choice you want highlighted - when the gui appears - :param str cancel_choice: If the user presses the 'X' close, which - button should be pressed - - :return: True if 'Yes' or dialog is cancelled, False if 'No' - """ - return boolbox(msg=msg, - title=title, - choices=choices, - image=image, - default_choice=default_choice, - cancel_choice=cancel_choice) - -# ----------------------------------------------------------------------- -# ccbox -# ----------------------------------------------------------------------- - - -def ccbox(msg="Shall I continue?", title=" ", - choices=("C[o]ntinue", "C[a]ncel"), image=None, - default_choice='Continue', cancel_choice='Cancel'): - """ - The ``ccbox()`` function offers a choice of Continue and Cancel, and returns either True (for continue) or False (for cancel). - - import easygui - msg = "Do you want to continue?" - title = "Please Confirm" - if easygui.ccbox(msg, title): # Show a Continue/Cancel dialog. - pass # User chose Continue. - else: # User chose Cancel. - sys.exit() - - :param str msg: the msg to be displayed - :param str title: the window title - :param list choices: a list or tuple of the choices to be displayed - :param str image: Filename of image to display - :param str default_choice: The choice you want highlighted - when the gui appears - :param str cancel_choice: If the user presses the 'X' close, - which button should be pressed - - :return: True if 'Continue' or dialog is cancelled, False if 'Cancel' - """ - return boolbox(msg=msg, - title=title, - choices=choices, - image=image, - default_choice=default_choice, - cancel_choice=cancel_choice) - -# ----------------------------------------------------------------------- -# boolbox -# ----------------------------------------------------------------------- - - -def boolbox(msg="Shall I continue?", title=" ", - choices=("[T]rue", "[F]alse"), image=None, - default_choice='[T]rue', cancel_choice='[F]alse'): - """ - The ``boolbox()`` (boolean box) displays two buttons. Returns returns - ``True`` if the first button is chosen. Otherwise returns ``False``. - - import easygui - message = "What do they say?" - title = "Romantic Question" - if easygui.boolbox(message, title, ["They love me", "They love me not"]): - easygui.msgbox('You should send them flowers.') - else: - easygui.msgbox('It was not meant to be.') - - :param str msg: The message shown in the center of the dialog window. - :param str title: The window title text. - :param list choices: A list or tuple of strings for the buttons' text. - :param str image: The filename of an image to display in the dialog window. - :param str default_choice: The text of the default selected button. - :param str cancel_choice: If the user presses the 'X' close, which button - should be pressed - :return: `True` if first button pressed or dialog is cancelled, `False` - if second button is pressed. - """ - if len(choices) != 2: - raise AssertionError( - 'boolbox() takes exactly 2 choices! Consider using indexbox() instead.' - ) - - reply = buttonbox(msg=msg, - title=title, - choices=choices, - image=image, - default_choice=default_choice, - cancel_choice=cancel_choice) - - if reply == choices[0]: - return True # The first button (True) was selected. - elif reply == choices[1]: - return False # The second button (False) was selected. - elif reply is None: - return None # The window was closed. - - assert False, "The user selected an unexpected response." - - -# ----------------------------------------------------------------------- -# indexbox -# ----------------------------------------------------------------------- -def indexbox(msg="Shall I continue?", title=" ", - choices=("Yes", "No"), image=None, - default_choice='Yes', cancel_choice='No'): - """ - The ``indexbox()`` function displays a set of buttons, and returns the - index of the selected button. For example, if you invoked index box with - three choices (A, B, C), indexbox would return 0 if the user picked A, 1 - if he picked B, and 2 if he picked C. - - import easygui - result = easygui.indexbox('Which door do you choose?', 'Win Prizes!', choices=['Door 1', 'Door 2', 'Door 3']) - if result == 2: - easygui.msgbox('You win a new car!') - else: - easygui.msgbox('Better luck next time.') - - :param str msg: the msg to be displayed - :param str title: the window title - :param list choices: a list or tuple of the choices to be displayed - :param str image: Filename of image to display - :param str default_choice: The choice you want highlighted - when the gui appears - :param str cancel_choice: If the user presses the 'X' close, - which button should be pressed - :return: the index of the choice selected, starting from 0 - """ - reply = buttonbox(msg=msg, - title=title, - choices=choices, - image=image, - default_choice=default_choice, - cancel_choice=cancel_choice) - if reply is None: - return None - for i, choice in enumerate(choices): - if reply == choice: - return i - msg = ("There is a program logic error in the EasyGui code " - "for indexbox.\nreply={0}, choices={1}".format( - reply, choices)) - raise AssertionError(msg) - - -# ----------------------------------------------------------------------- -# msgbox -# ----------------------------------------------------------------------- -def msgbox(msg="(Your message goes here)", title=" ", - ok_button="OK", image=None, root=None): - """ - The ``msgbox()`` function displays a text message and offers an OK - button. The message text appears in the center of the window, the title - text appears in the title bar, and you can replace the "OK" default text - on the button. Here is the signature:: - - def msgbox(msg="(Your message goes here)", title="", ok_button="OK"): - .... - - The clearest way to override the button text is to do it with a keyword - argument, like this:: - - easygui.msgbox("Backup complete!", ok_button="Good job!") - - Here are a couple of examples:: - - easygui.msgbox("Hello, world!") - - :param str msg: the msg to be displayed - :param str title: the window title - :param str ok_button: text to show in the button - :param str image: Filename of image to display - :param tk_widget root: Top-level Tk widget - :return: the text of the ok_button - """ - if not isinstance(ok_button, ut.basestring): - raise AssertionError( - "The 'ok_button' argument to msgbox must be a string.") - - return buttonbox(msg=msg, - title=title, - choices=[ok_button], - image=image, - default_choice=ok_button, - cancel_choice=ok_button) - - -def convert_to_type(input_value, new_type, input_value_name=None): - """ - Attempts to convert input_value to type new_type and throws error if it can't. - - If input_value is None, None is returned - If new_type is None, input_value is returned unchanged - :param input_value: Value to be converted - :param new_type: Type to convert to - :param input_value_name: If not None, used in error message if input_value cannot be converted - :return: input_value converted to new_type, or None - """ - if input_value is None or new_type is None: - return input_value - - exception_string = ( - 'value {0}:{1} must be of type {2}.') - ret_value = new_type(input_value) -# except ValueError: -# raise ValueError( -# exception_string.format('default', default, type(default))) - return ret_value - - -# ------------------------------------------------------------------- -# integerbox -# ------------------------------------------------------------------- -def integerbox(msg="", title=" ", default=None, - lowerbound=0, upperbound=99, image=None, root=None): - """ - Show a box in which a user can enter an integer. - - In addition to arguments for msg and title, this function accepts - integer arguments for "default", "lowerbound", and "upperbound". - - The default, lowerbound, or upperbound may be None. - - When the user enters some text, the text is checked to verify that it - can be converted to an integer between the lowerbound and upperbound. - - If it can be, the integer (not the text) is returned. - - If it cannot, then an error msg is displayed, and the integerbox is - redisplayed. - - If the user cancels the operation, None is returned. - - :param str msg: the msg to be displayed - :param str title: the window title - :param int default: The default value to return - :param int lowerbound: The lower-most value allowed - :param int upperbound: The upper-most value allowed - :param str image: Filename of image to display - :param tk_widget root: Top-level Tk widget - :return: the integer value entered by the user - - """ - - if not msg: - msg = "Enter an integer between {0} and {1}".format( - lowerbound, upperbound) - - # Validate the arguments for default, lowerbound and upperbound and - # convert to integers - default = convert_to_type(default, int, "default") - lowerbound = convert_to_type(lowerbound, int, "lowerbound") - upperbound = convert_to_type(upperbound, int, "upperbound") - - while True: - reply = enterbox(msg, title, default, image=image, root=root) - if reply is None: - return None - try: - reply = convert_to_type(reply, int) - except ValueError: - msgbox('The value that you entered:\n\t"{}"\nis not an integer.'.format(reply), "Error") - continue - if lowerbound is not None: - if reply < lowerbound: - msgbox('The value that you entered is less than the lower bound of {}.'.format(lowerbound), "Error") - continue - if upperbound is not None: - if reply > upperbound: - msgbox('The value that you entered is greater than the upper bound of {}.'.format(upperbound), "Error") - continue - # reply has passed all validation checks. - # It is an integer between the specified bounds. - break - return reply - - - - - - - -# ------------------------------------------------------------------- -# enterbox -# ------------------------------------------------------------------- -def enterbox(msg="Enter something.", title=" ", default="", - strip=True, image=None, root=None): - """ - Show a box in which a user can enter some text. - - You may optionally specify some default text, which will appear in the - enterbox when it is displayed. - - Example:: - - import easygui - reply = easygui.enterbox('Enter your life story:') - if reply: - easygui.msgbox('Thank you for your response.') - else: - easygui.msgbox('Your response has been discarded.') - - :param str msg: the msg to be displayed. - :param str title: the window title - :param str default: value returned if user does not change it - :param bool strip: If True, the return value will have - its whitespace stripped before being returned - :return: the text that the user entered, or None if they cancel - the operation. - """ - result = __fillablebox( - msg, title, default=default, mask=None, image=image, root=root) - if result and strip: - result = result.strip() - return result - - -def passwordbox(msg="Enter your password.", title=" ", default="", - image=None, root=None): - """ - Show a box in which a user can enter a password. - The text is masked with asterisks, so the password is not displayed. - - :param str msg: the msg to be displayed. - :param str title: the window title - :param str default: value returned if user does not change it - :return: the text that the user entered, or None if they cancel - the operation. - """ - return __fillablebox(msg, title, default, mask="*", - image=image, root=root) - - -# ----------------------------------------------------------------------- -# exceptionbox -# ----------------------------------------------------------------------- -def exceptionbox(msg=None, title=None): - """ - Display a box that gives information about - an exception that has just been raised. - - The caller may optionally pass in a title for the window, or a - msg to accompany the error information. - - Note that you do not need to (and cannot) pass an exception object - as an argument. The latest exception will automatically be used. - - :param str msg: the msg to be displayed - :param str title: the window title - :return: None - - """ - if title is None: - title = "Error Report" - if msg is None: - msg = "An error (exception) has occurred in the program." - - codebox(msg, title, ut.exception_format()) - - -# ------------------------------------------------------------------- -# codebox -# ------------------------------------------------------------------- - -def codebox(msg="", title=" ", text=""): - """ - Display some text in a monospaced font, with no line wrapping. - This function is suitable for displaying code and text that is - formatted using spaces. - - The text parameter should be a string, or a list or tuple of lines to be - displayed in the textbox. - - :param str msg: the msg to be displayed - :param str title: the window title - :param str text: what to display in the textbox - """ - return tb.textbox(msg, title, text, codebox=True) diff --git a/easygui/boxes/diropen_box.py b/easygui/boxes/diropen_box.py deleted file mode 100644 index fa626b1..0000000 --- a/easygui/boxes/diropen_box.py +++ /dev/null @@ -1,64 +0,0 @@ -""" - -.. moduleauthor:: easygui developers and Stephen Raymond Ferg -.. default-domain:: py -.. highlight:: python - -Version |release| -""" - - -import os -try: - from . import utils as ut -except (SystemError, ValueError, ImportError): - import utils as ut - -try: - import tkinter as tk # python 3 - import tkinter.font as tk_Font -except: - import Tkinter as tk # python 2 - import tkFont as tk_Font - - -# ------------------------------------------------------------------- -# diropenbox -# ------------------------------------------------------------------- -def diropenbox(msg=None, title=None, default=None): - """ - A dialog to get a directory name. - - Returns the name of a directory, or None if user chose to cancel. - - If the "default" argument specifies a directory name, and that - directory exists, then the dialog box will start with that directory. - - :param str msg: used in the window title on some platforms - :param str title: the window title - :param str default: starting directory when dialog opens - :return: Normalized path selected by user - """ - title = ut.getFileDialogTitle(msg, title) - localRoot = tk.Tk() - localRoot.withdraw() - localRoot.attributes("-topmost", True) - if not default: - default = None - localRoot.update() #fix ghost window issue #119 on mac. - f = ut.tk_FileDialog.askdirectory( - parent=localRoot, title=title, initialdir=default, initialfile=None - ) - localRoot.destroy() - if not f: - return None - return os.path.normpath(f) - - -if __name__ == '__main__': - print("Hello from base_boxes") - my_dir = diropenbox( - "You really should open a file", - title="Open a dir", - default='./') - print("directory {} selected.".format(my_dir)) diff --git a/easygui/boxes/fileboxsetup.py b/easygui/boxes/fileboxsetup.py deleted file mode 100644 index 739f904..0000000 --- a/easygui/boxes/fileboxsetup.py +++ /dev/null @@ -1,164 +0,0 @@ -""" - -.. moduleauthor:: easygui developers and Stephen Raymond Ferg -.. default-domain:: py -.. highlight:: python - -Version |release| - -""" -import os -try: - from . import utils as ut -except (SystemError, ValueError, ImportError): - import utils as ut - -try: - import tkinter as tk # python 3 - import tkinter.font as tk_Font -except: - import Tkinter as tk # python 2 - import tkFont as tk_Font - -# ------------------------------------------------------------------- -# -# fileboxSetup -# -# ------------------------------------------------------------------- - - -def fileboxSetup(default, filetypes): - if not default: - default = os.path.join(".", "*") - initialdir, initialfile = os.path.split(default) - if not initialdir: - initialdir = "." - if not initialfile: - initialfile = "*" - initialbase, initialext = os.path.splitext(initialfile) - initialFileTypeObject = FileTypeObject(initialfile) - - allFileTypeObject = FileTypeObject("*") - ALL_filetypes_was_specified = False - - if not filetypes: - filetypes = list() - filetypeObjects = list() - - for filemask in filetypes: - fto = FileTypeObject(filemask) - - if fto.isAll(): - ALL_filetypes_was_specified = True # remember this - - if fto == initialFileTypeObject: - initialFileTypeObject.add(fto) # add fto to initialFileTypeObject - else: - filetypeObjects.append(fto) - - # ------------------------------------------------------------------ - # make sure that the list of filetypes includes the ALL FILES type. - # ------------------------------------------------------------------ - if ALL_filetypes_was_specified: - pass - elif allFileTypeObject == initialFileTypeObject: - pass - else: - filetypeObjects.insert(0, allFileTypeObject) - # ------------------------------------------------------------------ - # Make sure that the list includes the initialFileTypeObject - # in the position in the list that will make it the default. - # This changed between Python version 2.5 and 2.6 - # ------------------------------------------------------------------ - if len(filetypeObjects) == 0: - filetypeObjects.append(initialFileTypeObject) - - if initialFileTypeObject in (filetypeObjects[0], filetypeObjects[-1]): - pass - else: - if ut.runningPython27: - filetypeObjects.append(initialFileTypeObject) - else: - filetypeObjects.insert(0, initialFileTypeObject) - - filetypes = [fto.toTuple() for fto in filetypeObjects] - - return initialbase, initialfile, initialdir, filetypes - - # Hotkeys - if buttons: - for button_name, button in buttons.items(): - hotkey_pressed = event.keysym - if event.keysym != event.char: # A special character - hotkey_pressed = '<{}>'.format(event.keysym) - if button['hotkey'] == hotkey_pressed: - __replyButtonText = button_name - boxRoot.quit() - return - - print("Event not understood") - - -# ------------------------------------------------------------------- -# class FileTypeObject for use with fileopenbox -# ------------------------------------------------------------------- -class FileTypeObject: - - def __init__(self, filemask): - if len(filemask) == 0: - raise AssertionError('Filetype argument is empty.') - - self.masks = list() - - if isinstance(filemask, ut.basestring): # a str or unicode - self.initializeFromString(filemask) - - elif isinstance(filemask, list): - if len(filemask) < 2: - raise AssertionError('Invalid filemask.\n' - + 'List contains less than 2 members: "{}"'.format(filemask)) - else: - self.name = filemask[-1] - self.masks = list(filemask[:-1]) - else: - raise AssertionError('Invalid filemask: "{}"'.format(filemask)) - - def __eq__(self, other): - if self.name == other.name: - return True - return False - - def add(self, other): - for mask in other.masks: - if mask in self.masks: - pass - else: - self.masks.append(mask) - - def toTuple(self): - return self.name, tuple(self.masks) - - def isAll(self): - if self.name == "All files": - return True - return False - - def initializeFromString(self, filemask): - # remove everything except the extension from the filemask - self.ext = os.path.splitext(filemask)[1] - if self.ext == "": - self.ext = ".*" - if self.ext == ".": - self.ext = ".*" - self.name = self.getName() - self.masks = ["*" + self.ext] - - def getName(self): - e = self.ext - file_types = {".*": "All", ".txt": "Text", - ".py": "Python", ".pyc": "Python", ".xls": "Excel"} - if e in file_types: - return '{} files'.format(file_types[e]) - if e.startswith("."): - return '{} files'.format(e[1:].upper()) - return '{} files'.format(e.upper()) diff --git a/easygui/boxes/fileopen_box.py b/easygui/boxes/fileopen_box.py deleted file mode 100644 index ea94eaf..0000000 --- a/easygui/boxes/fileopen_box.py +++ /dev/null @@ -1,130 +0,0 @@ -from __future__ import print_function -""" - -.. moduleauthor:: easygui developers and Stephen Raymond Ferg -.. default-domain:: py -.. highlight:: python - -Version |release| -""" - -import os -try: - from . import utils as ut - from . import fileboxsetup as fbs -except (SystemError, ValueError, ImportError): - import utils as ut - import fileboxsetup as fbs - -tk = ut.tk - - - -# ------------------------------------------------------------------- -# fileopenbox -# ------------------------------------------------------------------- - - -def fileopenbox(msg=None, title=None, default='*', filetypes=None, multiple=False): - """ - Displays an "open file" dialog box and returns the selected file as a string. - - The "default" argument specifies a filepath that (normally) - contains one or more wildcards. - - fileopenbox() will display only files that match the default filepath. - If omitted, defaults to "\\*" (all files in the current directory). - - WINDOWS EXAMPLE:: - - ...default="c:/myjunk/*.py" - - will open in directory c:\\myjunk\\ and show all Python files. - - WINDOWS EXAMPLE:: - - ...default="c:/myjunk/test*.py" - - will open in directory c:\\myjunk\\ and show all Python files - whose names begin with "test". - - - Note that on Windows, fileopenbox automatically changes the path - separator to the Windows path separator (backslash). - - **About the "filetypes" argument** - - If specified, it should contain a list of items, - where each item is either: - - - a string containing a filemask # e.g. "\\*.txt" - - a list of strings, where all of the strings except the last one - are filemasks (each beginning with "\\*.", - such as "\\*.txt" for text files, "\\*.py" for Python files, etc.). - and the last string contains a filetype description - - EXAMPLE:: - - filetypes = ["*.css", ["*.htm", "*.html", "HTML files"] ] - - .. note:: If the filetypes list does not contain ("All files","*"), it will be added. - - If the filetypes list does not contain a filemask that includes - the extension of the "default" argument, it will be added. - For example, if default="\\*abc.py" - and no filetypes argument was specified, then - "\\*.py" will automatically be added to the filetypes argument. - - :param str msg: the msg to be displayed. - :param str title: the window title - :param str default: filepath with wildcards - :param object filetypes: filemasks that a user can choose, e.g. "\\*.txt" - :param bool multiple: If true, more than one file can be selected - :return: the name of a file, or None if user chose to cancel - """ - localRoot = tk.Tk() - localRoot.withdraw() - localRoot.attributes("-topmost", True) - - initialbase, initialfile, initialdir, filetypes = fbs.fileboxSetup( - default, filetypes) - - # ------------------------------------------------------------ - # if initialfile contains no wildcards; we don't want an - # initial file. It won't be used anyway. - # Also: if initialbase is simply "*", we don't want an - # initialfile; it is not doing any useful work. - # ------------------------------------------------------------ - if (initialfile.find("*") < 0) and (initialfile.find("?") < 0): - initialfile = None - elif initialbase == "*": - initialfile = None - - func = ut.tk_FileDialog.askopenfilenames if multiple else ut.tk_FileDialog.askopenfilename - ret_val = func(parent=localRoot, - title=ut.getFileDialogTitle(msg, title), - initialdir=initialdir, initialfile=initialfile, - filetypes=filetypes - ) - if not ret_val or ret_val == '': - localRoot.destroy() - return None - if multiple: - f = [os.path.normpath(x) for x in localRoot.tk.splitlist(ret_val)] - else: - try: - f = os.path.normpath(ret_val) - except AttributeError as e: - print("ret_val is {}".format(ret_val)) - raise e - localRoot.destroy() - - if not f: - return None - return f - - -if __name__ == '__main__': - print("Hello from file open box") - ret_val = fileopenbox("Please select a file", "My File Open dialog") - print("Return value is:{}".format(ret_val)) diff --git a/easygui/boxes/filesave_box.py b/easygui/boxes/filesave_box.py deleted file mode 100644 index 4d453b8..0000000 --- a/easygui/boxes/filesave_box.py +++ /dev/null @@ -1,89 +0,0 @@ -""" - -.. moduleauthor:: easygui developers and Stephen Raymond Ferg -.. default-domain:: py -.. highlight:: python - -Version |release| -""" - - -import os - -try: - from . import utils as ut - from . import fileboxsetup as fbs -except (SystemError, ValueError, ImportError): - import utils as ut - import fileboxsetup as fbs - -try: - import tkinter as tk # python 3 - import tkinter.font as tk_Font -except: - import Tkinter as tk # python 2 - import tkFont as tk_Font - - - -# ------------------------------------------------------------------- -# filesavebox -# ------------------------------------------------------------------- - - -def filesavebox(msg=None, title=None, default="", filetypes=None): - """ - A file to get the name of a file to save. - Returns the name of a file, or None if user chose to cancel. - - **About the "default" argument** - - The ``default`` argument specifies the path and "glob pattern" for file - names. The "\\*" value, for example, sets the open file dialog to the - current working directory and showing all files. - - For another example, setting the ``default`` argument to ``"C:/myjunk/*.py"`` - sets the open file dialog to the C:\\myjunk folder and showing only files - that have the .py file extension. This glob pattern at the end of the - ``default`` argument is required: passing ``"C:/myjunk"`` would not set the - open file dialog to the C:\\myjunk folder, but rather to the C:\\ folder - and "myjunk" as the initial filename. - - Note that on Windows, ``fileopenbox()`` automatically changes the path - separator to the Windows path separator (backslash). - - - The "filetypes" argument works like the "filetypes" argument to - fileopenbox. - - :param str msg: the msg to be displayed. - :param str title: the window title - :param str default: default filename to return - :param object filetypes: filemasks that a user can choose, e.g. " \\*.txt" - :return: the name of a file, or None if user chose to cancel - """ - - localRoot = tk.Tk() - localRoot.withdraw() - localRoot.attributes("-topmost", True) - - initialbase, initialfile, initialdir, filetypes = fbs.fileboxSetup( - default, filetypes) - - f = ut.tk_FileDialog.asksaveasfilename( - parent=localRoot, - title=ut.getFileDialogTitle( - msg, title), - initialfile=initialfile, initialdir=initialdir, - filetypes=filetypes - ) - localRoot.destroy() - if not f: - return None - return os.path.normpath(f) - - -if __name__ == '__main__': - print("Hello from file save box") - ret_val = filesavebox("Please select a file to save to", "My File Save dialog") - print("Return value is:{}".format(ret_val)) \ No newline at end of file diff --git a/easygui/boxes/fillable_box.py b/easygui/boxes/fillable_box.py deleted file mode 100644 index f5fbf3b..0000000 --- a/easygui/boxes/fillable_box.py +++ /dev/null @@ -1,177 +0,0 @@ -try: - from . import utils as ut - from . import global_state - from .base_boxes import bindArrows -except (SystemError, ValueError, ImportError): - import utils as ut - import global_state - from base_boxes import bindArrows - -try: - import tkinter as tk # python 3 - import tkinter.font as tk_Font -except: - import Tkinter as tk # python 2 - import tkFont as tk_Font - -# TODO: bindArrows seems to be in the wrong place. - - -boxRoot = None -entryWidget = None -__enterboxText = '' -__enterboxDefaultText = '' -cancelButton = None -okButton = None - - -def __fillablebox(msg, title="", default="", mask=None, image=None, root=None): - """ - Show a box in which a user can enter some text. - You may optionally specify some default text, which will appear in the - enterbox when it is displayed. - Returns the text that the user entered, or None if they cancel the operation. - """ - - global boxRoot, __enterboxText, __enterboxDefaultText - global cancelButton, entryWidget, okButton - - if title is None: - title = "" - if default is None: - default = "" - __enterboxDefaultText = default - __enterboxText = __enterboxDefaultText - - if root: - root.withdraw() - boxRoot = tk.Toplevel(master=root) - boxRoot.withdraw() - else: - boxRoot = tk.Tk() - boxRoot.withdraw() - - boxRoot.protocol('WM_DELETE_WINDOW', __enterboxQuit) - boxRoot.title(title) - boxRoot.iconname('Dialog') - boxRoot.geometry(global_state.window_position) - boxRoot.bind("", __enterboxCancel) - - # ------------- define the messageFrame --------------------------------- - messageFrame = tk.Frame(master=boxRoot) - messageFrame.pack(side=tk.TOP, fill=tk.BOTH) - - # ------------- define the imageFrame --------------------------------- - try: - tk_Image = ut.load_tk_image(image) - except Exception as inst: - print(inst) - tk_Image = None - if tk_Image: - imageFrame = tk.Frame(master=boxRoot) - imageFrame.pack(side=tk.TOP, fill=tk.BOTH) - label = tk.Label(imageFrame, image=tk_Image) - label.image = tk_Image # keep a reference! - label.pack(side=tk.TOP, expand=tk.YES, fill=tk.X, padx='1m', pady='1m') - - # ------------- define the buttonsFrame --------------------------------- - buttonsFrame = tk.Frame(master=boxRoot) - buttonsFrame.pack(side=tk.TOP, fill=tk.BOTH) - - # ------------- define the entryFrame --------------------------------- - entryFrame = tk.Frame(master=boxRoot) - entryFrame.pack(side=tk.TOP, fill=tk.BOTH) - - # ------------- define the buttonsFrame --------------------------------- - buttonsFrame = tk.Frame(master=boxRoot) - buttonsFrame.pack(side=tk.TOP, fill=tk.BOTH) - - # -------------------- the msg widget ---------------------------- - messageWidget = tk.Message(messageFrame, width="4.5i", text=msg) - messageWidget.configure( - font=(global_state.PROPORTIONAL_FONT_FAMILY, global_state.PROPORTIONAL_FONT_SIZE)) - messageWidget.pack( - side=tk.RIGHT, expand=1, fill=tk.BOTH, padx='3m', pady='3m') - - # --------- entryWidget ---------------------------------------------- - entryWidget = tk.Entry(entryFrame, width=40) - bindArrows(entryWidget) - entryWidget.configure( - font=(global_state.PROPORTIONAL_FONT_FAMILY, global_state.TEXT_ENTRY_FONT_SIZE)) - if mask: - entryWidget.configure(show=mask) - entryWidget.pack(side=tk.LEFT, padx="3m") - entryWidget.bind("", __enterboxGetText) - entryWidget.bind("", __enterboxCancel) - # put text into the entryWidget - entryWidget.insert(0, __enterboxDefaultText) - - # ------------------ ok button ------------------------------- - okButton = tk.Button(buttonsFrame, takefocus=1, text="OK") - bindArrows(okButton) - okButton.pack( - expand=1, side=tk.LEFT, padx='3m', pady='3m', ipadx='2m', ipady='1m') - - # for the commandButton, bind activation events to the activation event - # handler - commandButton = okButton - handler = __enterboxGetText - for selectionEvent in global_state.STANDARD_SELECTION_EVENTS: - commandButton.bind("<{}>".format(selectionEvent), handler) - - mouse_handlers = ut.mouse_click_handlers(__enterboxGetText) - for selectionEvent in global_state.STANDARD_SELECTION_EVENTS_MOUSE: - okButton.bind("<%s>" % selectionEvent, mouse_handlers[selectionEvent]) - - # ------------------ cancel button ------------------------------- - cancelButton = tk.Button(buttonsFrame, takefocus=1, text="Cancel") - bindArrows(cancelButton) - cancelButton.pack( - expand=1, side=tk.RIGHT, padx='3m', pady='3m', ipadx='2m', ipady='1m') - - # for the commandButton, bind activation events to the activation event - # handler - commandButton = cancelButton - handler = __enterboxCancel - for selectionEvent in global_state.STANDARD_SELECTION_EVENTS: - commandButton.bind("<{}>".format(selectionEvent), handler) - mouse_handlers = ut.mouse_click_handlers(__enterboxCancel) - for selectionEvent in global_state.STANDARD_SELECTION_EVENTS_MOUSE: - cancelButton.bind("<%s>" % selectionEvent, mouse_handlers[selectionEvent]) - - - # ------------------- time for action! ----------------- - entryWidget.focus_force() # put the focus on the entryWidget - boxRoot.deiconify() - boxRoot.mainloop() # run it! - - # -------- after the run has completed ---------------------------------- - if root: - root.deiconify() - boxRoot.destroy() # button_click didn't destroy boxRoot, so we do it now - return __enterboxText - - -def __enterboxQuit(): - return __enterboxCancel(None) - - -def __enterboxCancel(event): - global __enterboxText - - __enterboxText = None - boxRoot.quit() - - -def __enterboxGetText(event): - global __enterboxText - - __enterboxText = entryWidget.get() - boxRoot.quit() - - -def __enterboxRestore(event): - global entryWidget - - entryWidget.delete(0, len(entryWidget.get())) - entryWidget.insert(0, __enterboxDefaultText) diff --git a/easygui/boxes/global_state.py b/easygui/boxes/global_state.py deleted file mode 100644 index 86d74ac..0000000 --- a/easygui/boxes/global_state.py +++ /dev/null @@ -1,29 +0,0 @@ -""" - -.. moduleauthor:: easygui developers and Stephen Raymond Ferg -.. default-domain:: py -.. highlight:: python - -Version |release| -""" - -# Starting and global variables - -window_position = "+300+200" - -PROPORTIONAL_FONT_FAMILY = ("MS", "Sans", "Serif") -MONOSPACE_FONT_FAMILY = "Courier" - -PROPORTIONAL_FONT_SIZE = 10 -# a little smaller, because it is more legible at a smaller size -MONOSPACE_FONT_SIZE = 9 -TEXT_ENTRY_FONT_SIZE = 12 # a little larger makes it easier to see - - -STANDARD_SELECTION_EVENTS = ["Return", "space"] -STANDARD_SELECTION_EVENTS_MOUSE = ["Enter", "Leave", "ButtonRelease-1"] - -prop_font_line_length = 62 -fixw_font_line_length = 80 -num_lines_displayed = 50 -default_hpad_in_chars = 2 diff --git a/easygui/boxes/multi_fillable_box.py b/easygui/boxes/multi_fillable_box.py deleted file mode 100644 index f512add..0000000 --- a/easygui/boxes/multi_fillable_box.py +++ /dev/null @@ -1,507 +0,0 @@ -""" - -.. moduleauthor:: easygui developers and Stephen Raymond Ferg -.. default-domain:: py -.. highlight:: python - -Version |release| -""" -from easygui.boxes.utils import mouse_click_handlers - -try: - from . import global_state -except: - import global_state - -try: - import tkinter as tk # python 3 -except: - import Tkinter as tk # python 2 - -# ----------------------------------------------------------------------- -# multpasswordbox -# ----------------------------------------------------------------------- - - -def multpasswordbox(msg="Fill in values for the fields.", - title=" ", fields=tuple(), values=tuple(), - callback=None, run=True): - r""" - Same interface as multenterbox. But in multpassword box, - the last of the fields is assumed to be a password, and - is masked with asterisks. - - :param str msg: the msg to be displayed. - :param str title: the window title - :param list fields: a list of fieldnames. - :param list values: a list of field values - :return: String - - **Example** - - Here is some example code, that shows how values returned from - multpasswordbox can be checked for validity before they are accepted:: - - msg = "Enter logon information" - title = "Demo of multpasswordbox" - fieldNames = ["Server ID", "User ID", "Password"] - fieldValues = [] # we start with blanks for the values - fieldValues = multpasswordbox(msg,title, fieldNames) - - # make sure that none of the fields was left blank - while 1: - if fieldValues is None: break - errmsg = "" - for i in range(len(fieldNames)): - if fieldValues[i].strip() == "": - errmsg = errmsg + ('"%s" is a required field.\n\n' % - fieldNames[i]) - if errmsg == "": break # no problems found - fieldValues = multpasswordbox(errmsg, title, - fieldNames, fieldValues) - - print("Reply was: %s" % str(fieldValues)) - - """ - if run: - mb = MultiBox(msg, title, fields, values, mask_last=True, - callback=callback) - - reply = mb.run() - - return reply - - else: - - mb = MultiBox(msg, title, fields, values, mask_last=True, - callback=callback) - - return mb - - -# ------------------------------------------------------------------- -# multenterbox -# ------------------------------------------------------------------- -# TODO RL: Should defaults be list constructors. -# i think after multiple calls, the value is retained. -# TODO RL: Rename/alias to multienterbox? -# default should be None and then in the logic create an empty liglobal_state. -def multenterbox(msg="Fill in values for the fields.", title=" ", - fields=[], values=[], callback=None, run=True): - r""" - Show screen with multiple data entry fields. - - If there are fewer values than names, the list of values is padded with - empty strings until the number of values is the same as the number - of names. - - If there are more values than names, the list of values - is truncated so that there are as many values as names. - - Returns a list of the values of the fields, - or None if the user cancels the operation. - - Here is some example code, that shows how values returned from - multenterbox can be checked for validity before they are accepted:: - - msg = "Enter your personal information" - title = "Credit Card Application" - fieldNames = ["Name","Street Address","City","State","ZipCode"] - fieldValues = [] # we start with blanks for the values - fieldValues = multenterbox(msg,title, fieldNames) - - # make sure that none of the fields was left blank - while 1: - if fieldValues is None: break - errmsg = "" - for i in range(len(fieldNames)): - if fieldValues[i].strip() == "": - errmsg += ('"%s" is a required field.\n\n' % fieldNames[i]) - if errmsg == "": - break # no problems found - fieldValues = multenterbox(errmsg, title, fieldNames, fieldValues) - - print("Reply was: %s" % str(fieldValues)) - - :param str msg: the msg to be displayed. - :param str title: the window title - :param list fields: a list of fieldnames. - :param list values: a list of field values - :return: String - """ - if run: - mb = MultiBox(msg, title, fields, values, mask_last=False, - callback=callback) - reply = mb.run() - return reply - else: - mb = MultiBox(msg, title, fields, values, mask_last=False, - callback=callback) - return mb - - -class MultiBox(object): - - """ Show multiple data entry fields - - This object does a number of things: - - - chooses a GUI framework (wx, qt) - - checks the data sent to the GUI - - performs the logic (button ok should close the window?) - - defines what methods the user can invoke and - what properties he can change. - - calls the ui in defined ways, so other gui - frameworks can be used without breaking anything to the user - """ - - def __init__(self, msg, title, fields, values, mask_last, callback): - """ Create box object - - Parameters - ---------- - msg : string - text displayed in the message area (instructions...) - title : str - the window title - fields: list - names of fields - values: list - initial values - callback: function - if set, this function will be called when OK is pressed - run: bool - if True, a box object will be created and returned, but not run - - Returns - ------- - self - The MultiBox object - """ - - self.callback = callback - - self.fields, self.values = self.check_fields(fields, values) - - self.ui = GUItk(msg, title, self.fields, self.values, - mask_last, self.callback_ui) - - def run(self): - """ Start the ui """ - self.ui.run() - self.ui = None - return self.values - - def stop(self): - """ Stop the ui """ - self.ui.stop() - - def callback_ui(self, ui, command, values): - """ This method is executed when ok, cancel, or x is pressed in the ui. - """ - if command == 'update': # OK was pressed - self.values = values - if self.callback: - # If a callback was set, call main process - self.callback(self) - else: - self.stop() - elif command == 'x': - self.stop() - self.values = None - elif command == 'cancel': - self.stop() - self.values = None - - # methods to change properties -------------- - - @property - def msg(self): - """Text in msg Area""" - return self._msg - - @msg.setter - def msg(self, msg): - self.ui.set_msg(msg) - - @msg.deleter - def msg(self): - self._msg = "" - self.ui.set_msg(self._msg) - - # Methods to validate what will be sent to ui --------- - - def check_fields(self, fields, values): - if len(fields) == 0: - return None - - fields = list(fields[:]) # convert possible tuples to a list - values = list(values[:]) # convert possible tuples to a list - - # TODO RL: The following seems incorrect when values>fields. Replace - # below with zip? - if len(values) == len(fields): - pass - elif len(values) > len(fields): - fields = fields[0:len(values)] - else: - while len(values) < len(fields): - values.append("") - - return fields, values - - -class GUItk(object): - - """ This object contains the tk root object. - It draws the window, waits for events and communicates them - to MultiBox, together with the entered values. - - The position in wich it is drawn comes from a global variable. - - It also accepts commands from Multibox to change its message. - """ - - def __init__(self, msg, title, fields, values, mask_last, callback): - - self.callback = callback - - self.boxRoot = tk.Tk() - - self.create_root(title) - - self.set_pos(global_state.window_position) # GLOBAL POSITION - - self.create_msg_widget(msg) - - self.create_entryWidgets(fields, values, mask_last) - - self.create_buttons() - - self.entryWidgets[0].focus_force() # put the focus on the entryWidget - - # Run and stop methods --------------------------------------- - - def run(self): - self.boxRoot.mainloop() # run it! - self.boxRoot.destroy() # Close the window - - def stop(self): - # Get the current position before quitting - self.get_pos() - - self.boxRoot.quit() - - def x_pressed(self): - self.callback(self, command='x', values=self.get_values()) - - def cancel_pressed(self, event): - self.callback(self, command='cancel', values=self.get_values()) - - def ok_pressed(self, event): - self.callback(self, command='update', values=self.get_values()) - - # Methods to change content --------------------------------------- - - def set_msg(self, msg): - self.messageWidget.configure(text=msg) - self.entryWidgets[0].focus_force() # put the focus on the entryWidget - - def set_pos(self, pos): - self.boxRoot.geometry(pos) - - def get_pos(self): - # The geometry() method sets a size for the window and positions it on - # the screen. The first two parameters are width and height of - # the window. The last two parameters are x and y screen coordinates. - # geometry("250x150+300+300") - geom = self.boxRoot.geometry() # "628x672+300+200" - global_state.window_position = '+' + geom.split('+', 1)[1] - - def get_values(self): - values = [] - for entryWidget in self.entryWidgets: - values.append(entryWidget.get()) - return values - - # Initial configuration methods --------------------------------------- - # These ones are just called once, at setting. - - def create_root(self, title): - - self.boxRoot.protocol('WM_DELETE_WINDOW', self.x_pressed) - self.boxRoot.title(title) - self.boxRoot.iconname('Dialog') - self.boxRoot.bind("", self.cancel_pressed) - self.boxRoot.attributes("-topmost", True) # Put the dialog box in focus. - - def create_msg_widget(self, msg): - # -------------------- the msg widget ---------------------------- - self.messageWidget = tk.Message(self.boxRoot, width="4.5i", text=msg) - self.messageWidget.configure( - font=(global_state.PROPORTIONAL_FONT_FAMILY, global_state.PROPORTIONAL_FONT_SIZE)) - self.messageWidget.pack( - side=tk.TOP, expand=1, fill=tk.BOTH, padx='3m', pady='3m') - - def create_entryWidgets(self, fields, values, mask_last): - - self.entryWidgets = [] - - lastWidgetIndex = len(fields) - 1 - - for widgetIndex in range(len(fields)): - name = fields[widgetIndex] - value = values[widgetIndex] - entryFrame = tk.Frame(master=self.boxRoot) - entryFrame.pack(side=tk.TOP, fill=tk.BOTH) - - # --------- entryWidget ------------------------------------------- - labelWidget = tk.Label(entryFrame, text=name) - labelWidget.pack(side=tk.LEFT) - - entryWidget = tk.Entry(entryFrame, width=40, highlightthickness=2) - self.entryWidgets.append(entryWidget) - entryWidget.configure( - font=(global_state.PROPORTIONAL_FONT_FAMILY, global_state.TEXT_ENTRY_FONT_SIZE)) - entryWidget.pack(side=tk.RIGHT, padx="3m") - - self.bindArrows(entryWidget) - - entryWidget.bind("", self.ok_pressed) - entryWidget.bind("", self.cancel_pressed) - - # for the last entryWidget, if this is a multpasswordbox, - # show the contents as just asterisks - if widgetIndex == lastWidgetIndex: - if mask_last: - self.entryWidgets[widgetIndex].configure(show="*") - - # put text into the entryWidget - if value is None: - value = '' - self.entryWidgets[widgetIndex].insert( - 0, '{}'.format(value)) - - def create_buttons(self): - self.buttonsFrame = tk.Frame(master=self.boxRoot) - self.buttonsFrame.pack(side=tk.BOTTOM) - - self.create_cancel_button() - self.create_ok_button() - - def create_ok_button(self): - - okButton = tk.Button(self.buttonsFrame, takefocus=1, text="OK") - self.bindArrows(okButton) - okButton.pack(expand=1, side=tk.LEFT, padx='3m', pady='3m', - ipadx='2m', ipady='1m') - - # for the commandButton, bind activation events to the activation event - # handler - commandButton = okButton - handler = self.ok_pressed - for selectionEvent in global_state.STANDARD_SELECTION_EVENTS: - commandButton.bind("<%s>" % selectionEvent, handler) - - mouse_handlers = mouse_click_handlers(self.ok_pressed) - for selectionEvent in global_state.STANDARD_SELECTION_EVENTS_MOUSE: - commandButton.bind("<%s>" % selectionEvent, mouse_handlers[selectionEvent]) - - - def create_cancel_button(self): - - cancelButton = tk.Button(self.buttonsFrame, takefocus=1, text="Cancel") - self.bindArrows(cancelButton) - cancelButton.pack(expand=1, side=tk.LEFT, padx='3m', pady='3m', - ipadx='2m', ipady='1m') - - # for the commandButton, bind activation events to the activation event - # handler - commandButton = cancelButton - handler = self.cancel_pressed - for selectionEvent in global_state.STANDARD_SELECTION_EVENTS: - commandButton.bind("<%s>" % selectionEvent, handler) - - mouse_handlers = mouse_click_handlers(self.cancel_pressed) - for selectionEvent in global_state.STANDARD_SELECTION_EVENTS_MOUSE: - commandButton.bind("<%s>" % selectionEvent, mouse_handlers[selectionEvent]) - - - def bindArrows(self, widget): - - widget.bind("", self.tabRight) - widget.bind("", self.tabLeft) - - widget.bind("", self.tabRight) - widget.bind("", self.tabLeft) - - def tabRight(self, event): - self.boxRoot.event_generate("") - - def tabLeft(self, event): - self.boxRoot.event_generate("") - - -def demo1(): - msg = "Enter your personal information" - title = "Credit Card Application" - fieldNames = ["Name", "Street Address", "City", "State", "ZipCode"] - fieldValues = [] # we start with blanks for the values - - # make sure that none of the fields was left blank - while True: - - fieldValues = multenterbox(msg, title, fieldNames, fieldValues) - cancelled = fieldValues is None - errors = [] - if cancelled: - pass - else: # check for errors - for name, value in zip(fieldNames, fieldValues): - if value.strip() == "": - errors.append('"{}" is a required field.'.format(name)) - - all_ok = not errors - - if cancelled or all_ok: - break # no problems found - - msg = "\n".join(errors) - - print("Reply was: {}".format(fieldValues)) - - -class Demo2(): - - def __init__(self): - msg = "Without flicker. Enter your personal information" - title = "Credit Card Application" - fieldNames = ["Name", "Street Address", "City", "State", "ZipCode"] - fieldValues = [] # we start with blanks for the values - - fieldValues = multenterbox(msg, title, fieldNames, fieldValues, - callback=self.check_for_blank_fields) - print("Reply was: {}".format(fieldValues)) - - def check_for_blank_fields(self, box): - # make sure that none of the fields was left blank - cancelled = box.values is None - errors = [] - if cancelled: - pass - else: # check for errors - for name, value in zip(box.fields, box.values): - if value.strip() == "": - errors.append('"{}" is a required field.'.format(name)) - - all_ok = not errors - - if cancelled or all_ok: - box.stop() # no problems found - - box.msg = "\n".join(errors) - - -if __name__ == '__main__': - demo1() - Demo2() diff --git a/easygui/boxes/text_box.py b/easygui/boxes/text_box.py deleted file mode 100644 index 86216c5..0000000 --- a/easygui/boxes/text_box.py +++ /dev/null @@ -1,584 +0,0 @@ -""" - -.. moduleauthor:: easygui developers and Stephen Raymond Ferg -.. default-domain:: py -.. highlight:: python - -Version |release| -""" - - -import sys - -from easygui.boxes.utils import mouse_click_handlers - -try: - from . import global_state -except (SystemError, ValueError, ImportError): - import global_state - -try: - import tkinter as tk # python 3 - import tkinter.font as tk_Font -except: - import Tkinter as tk # python 2 - import tkFont as tk_Font - - -def demo_textbox(): - demo_1() - Demo2() - Demo3() - - -def demo_1(): - - title = "Demo of textbox: Classic box" - - gnexp = ("This is a demo of the classic textbox call, " - "you can see it closes when ok is pressed.\n\n") - - challenge = "INSERT A TEXT WITH MORE THAN TWO PARAGRAPHS" - - text = "Insert your text here\n" - - msg = gnexp + challenge - - finished = False - while True: - - text = textbox(msg, title, text) - escaped = not text - if escaped or finished: - break - - if text.count("\n") >= 2: - msg = (u"You did it right! Press OK") - finished = True - else: - msg = u"You did it wrong! Try again!\n" + challenge - - -class Demo2(object): - - """ Program that challenges the user to write 5 a's """ - - def __init__(self): - """ Set and run the program """ - - title = "Demo of textbox: Classic box with callback" - - gnexp = ("This is a demo of the textbox with a callback, " - "it doesn't flicker!.\n\n") - - msg = "INSERT A TEXT WITH FIVE OR MORE A\'s" - - text_snippet = "Insert your text here" - - self.finished = False - - textbox(gnexp + msg, title, text_snippet, False, - callback=self.check_answer, run=True) - - def check_answer(self, box): - """ Callback from TextBox - - Parameters - ----------- - box: object - object containing parameters and methods to communicate with the ui - - Returns - ------- - nothing: - its return is through the box object - """ - - if self.finished: - box.stop() - - if box.text.lower().count("a") >= 5: - box.msg = u"\n\nYou did it right! Press OK button to continue." - box.stop() - self.finished - else: - box.msg = u"\n\nMore a's are needed!" - - -class Demo3(object): - - """ Program that challenges the user to find a typo """ - - def __init__(self): - """ Set and run the program """ - - self.finished = False - - title = "Demo of textbox: Object with callback" - - msg = ("This is a demo of the textbox set as " - "an object with a callback, " - "you can configure it and when you are finished, " - "you run it.\n\nThere is a typo in it. Find and correct it.") - - text_snippet = "Hello" # This text wont show - - box = textbox( - msg, title, text_snippet, False, callback=self.check_answer, run=False) - - box.text = ( - "It was the west of times, and it was the worst of times. " - "The rich ate cake, and the poor had cake recommended to them, " - "but wished only for enough cash to buy bread." - "The time was ripe for revolution! ") - - box.run() - - def check_answer(self, box): - """ Callback from TextBox - - Parameters - ---------- - box: object - object containing parameters and methods to communicate with the ui - - Returns - ------- - nothing: - its return is through the box object - """ - if self.finished: - box.stop() - - if "best" in box.text: - box.msg = u"\n\nYou did right! Press OK button to continue." - self.finished = True - else: - box.msg = u"\n\nLook to the west!" - - -def textbox(msg="", title=" ", text="", - codebox=False, callback=None, run=True): - """Displays a dialog box with a large, multi-line text box, and returns - the entered text as a string. The message text is displayed in a - proportional font and wraps. - - Parameters - ---------- - msg : string - text displayed in the message area (instructions...) - title : str - the window title - text: str, list or tuple - text displayed in textAreas (editable) - codebox: bool - if True, don't wrap and width is set to 80 chars - callback: function - if set, this function will be called when OK is pressed - run: bool - if True, a box object will be created and returned, but not run - - Returns - ------- - None - If cancel is pressed - str - If OK is pressed returns the contents of textArea - - """ - - tb = TextBox(msg=msg, title=title, text=text, - codebox=codebox, callback=callback) - if not run: - return tb - else: - reply = tb.run() - return reply - - -class TextBox(object): - - """ Display a message and a text to edit - - This object separates user from ui, defines which methods can - the user invoke and which properties can he change. - - It also calls the ui in defined ways, so if other gui - library can be used (wx, qt) without breaking anything for the user. - """ - - def __init__(self, msg, title, text, codebox, callback=lambda *args, **kwargs: True): - """ Create box object - - Parameters - ---------- - msg : string - text displayed in the message area (instructions...) - title : str - the window title - text: str, list or tuple - text displayed in textAres (editable) - codebox: bool - if True, don't wrap and width is set to 80 chars - callback: function - if set, this function will be called when OK is pressed - - Returns - ------- - object - The box object - """ - - self.callback = callback - self.ui = GUItk(msg, title, text, codebox, self.callback_ui) - self.text = text - - def run(self): - """ Start the ui """ - self.ui.run() - self.ui = None - return self._text - - def stop(self): - """ Stop the ui """ - self.ui.stop() - - def callback_ui(self, ui, command, text): - """ This method is executed when ok, cancel, or x is pressed in the ui. - """ - if command == 'update': # OK was pressed - self._text = text - if self.callback: - # If a callback was set, call main process - self.callback(self) - else: - self.stop() - elif command == 'x': - self.stop() - self._text = None - elif command == 'cancel': - self.stop() - self._text = None - - # methods to change properties -------------- - @property - def text(self): - """Text in text Area""" - return self._text - - @text.setter - def text(self, text): - self._text = self.to_string(text) - self.ui.set_text(self._text) - - @text.deleter - def text(self): - self._text = "" - self.ui.set_text(self._text) - - @property - def msg(self): - """Text in msg Area""" - return self._msg - - @msg.setter - def msg(self, msg): - self._msg = self.to_string(msg) - self.ui.set_msg(self._msg) - - @msg.deleter - def msg(self): - self._msg = "" - self.ui.set_msg(self._msg) - - # Methods to validate what will be sent to ui --------- - - def to_string(self, something): - try: - basestring # python 2 - except NameError: - basestring = str # Python 3 - - if isinstance(something, basestring): - return something - try: - text = "".join(something) # convert a list or a tuple to a string - except: - textbox( - "Exception when trying to convert {} to text in self.textArea" - .format(type(something))) - sys.exit(16) - return text - - -class GUItk(object): - - """ This is the object that contains the tk root object""" - - def __init__(self, msg, title, text, codebox, callback): - """ Create ui object - - Parameters - ---------- - msg : string - text displayed in the message area (instructions...) - title : str - the window title - text: str, list or tuple - text displayed in textAres (editable) - codebox: bool - if True, don't wrap, and width is set to 80 chars - callback: function - if set, this function will be called when OK is pressed - - Returns - ------- - object - The ui object - """ - - self.callback = callback - - self.boxRoot = tk.Tk() - # self.boxFont = tk_Font.Font( - # family=global_state.PROPORTIONAL_FONT_FAMILY, - # size=global_state.PROPORTIONAL_FONT_SIZE) - - wrap_text = not codebox - if wrap_text: - self.boxFont = tk_Font.nametofont("TkTextFont") - self.width_in_chars = global_state.prop_font_line_length - else: - self.boxFont = tk_Font.nametofont("TkFixedFont") - self.width_in_chars = global_state.fixw_font_line_length - - # default_font.configure(size=global_state.PROPORTIONAL_FONT_SIZE) - - self.configure_root(title) - - self.create_msg_widget(msg) - - self.create_text_area(wrap_text) - - self.create_buttons_frame() - - self.create_cancel_button() - - self.create_ok_button() - - # Run and stop methods --------------------------------------- - - def run(self): - self.boxRoot.mainloop() - self.boxRoot.destroy() - - def stop(self): - # Get the current position before quitting - self.get_pos() - self.boxRoot.quit() - - # Methods to change content --------------------------------------- - - def set_msg(self, msg): - self.messageArea.config(state=tk.NORMAL) - self.messageArea.delete(1.0, tk.END) - self.messageArea.insert(tk.END, msg) - self.messageArea.config(state=tk.DISABLED) - # Adjust msg height - self.messageArea.update() - numlines = self.get_num_lines(self.messageArea) - self.set_msg_height(numlines) - self.messageArea.update() - - def set_msg_height(self, numlines): - self.messageArea.configure(height=numlines) - - def get_num_lines(self, widget): - end_position = widget.index(tk.END) # '4.0' - end_line = end_position.split('.')[0] # 4 - return int(end_line) # 5 - - def set_text(self, text): - self.textArea.delete(1.0, tk.END) - self.textArea.insert(tk.END, text, "normal") - self.textArea.focus() - - def set_pos(self, pos): - self.boxRoot.geometry(pos) - - def get_pos(self): - # The geometry() method sets a size for the window and positions it on - # the screen. The first two parameters are width and height of - # the window. The last two parameters are x and y screen coordinates. - # geometry("250x150+300+300") - geom = self.boxRoot.geometry() # "628x672+300+200" - global_state.window_position = '+' + geom.split('+', 1)[1] - - def get_text(self): - return self.textArea.get(0.0, 'end-1c') - - # Methods executing when a key is pressed ------------------------------- - def x_pressed(self): - self.callback(self, command='x', text=self.get_text()) - - def cancel_pressed(self, event): - self.callback(self, command='cancel', text=self.get_text()) - - def ok_button_pressed(self, event): - self.callback(self, command='update', text=self.get_text()) - - # Auxiliary methods ----------------------------------------------- - def calc_character_width(self): - char_width = self.boxFont.measure('W') - return char_width - - # Initial configuration methods --------------------------------------- - # These ones are just called once, at setting. - - def configure_root(self, title): - - self.boxRoot.title(title) - - self.set_pos(global_state.window_position) - - # Quit when x button pressed - self.boxRoot.protocol('WM_DELETE_WINDOW', self.x_pressed) - self.boxRoot.bind("", self.cancel_pressed) - - self.boxRoot.iconname('Dialog') - - self.boxRoot.attributes("-topmost", True) # Put the dialog box in focus. - - def create_msg_widget(self, msg): - - if msg is None: - msg = "" - - self.msgFrame = tk.Frame( - self.boxRoot, - padx=1.25 * self.calc_character_width(), - - ) - self.messageArea = tk.Text( - self.msgFrame, - width=self.width_in_chars, - state=tk.DISABLED, - padx=(global_state.default_hpad_in_chars) * - self.calc_character_width(), - pady=self.calc_character_width(), - wrap=tk.WORD, - - ) - self.set_msg(msg) - - self.msgFrame.pack(fill='x') - - self.messageArea.pack(fill='x') - - def create_text_area(self, wrap_text): - """ - Put a textArea in the top frame - Put and configure scrollbars - """ - - self.textFrame = tk.Frame( - self.boxRoot, - padx=1.25 * self.calc_character_width(), - ) - - self.textFrame.pack(side=tk.TOP) - # self.textFrame.grid(row=1, column=0, sticky=tk.EW) - - self.textArea = tk.Text( - self.textFrame, - padx=global_state.default_hpad_in_chars * - self.calc_character_width(), - pady=global_state.default_hpad_in_chars * - self.calc_character_width(), - height=25, # lines. Note: a user-set arg would be preferable to hardcoded value - width=self.width_in_chars, # chars of the current font - ) - - if wrap_text: - self.textArea.configure(wrap=tk.WORD) - else: - self.textArea.configure(wrap=tk.NONE) - - # some simple keybindings for scrolling - self.boxRoot.bind("", self.textArea.yview_scroll(1, tk.PAGES)) - self.boxRoot.bind( - "", self.textArea.yview_scroll(-1, tk.PAGES)) - - self.boxRoot.bind("", self.textArea.xview_scroll(1, tk.PAGES)) - self.boxRoot.bind("", self.textArea.xview_scroll(-1, tk.PAGES)) - - self.boxRoot.bind("", self.textArea.yview_scroll(1, tk.UNITS)) - self.boxRoot.bind("", self.textArea.yview_scroll(-1, tk.UNITS)) - - # add a vertical scrollbar to the frame - rightScrollbar = tk.Scrollbar( - self.textFrame, orient=tk.VERTICAL, command=self.textArea.yview) - self.textArea.configure(yscrollcommand=rightScrollbar.set) - - # add a horizontal scrollbar to the frame - bottomScrollbar = tk.Scrollbar( - self.textFrame, orient=tk.HORIZONTAL, command=self.textArea.xview) - self.textArea.configure(xscrollcommand=bottomScrollbar.set) - - # pack the textArea and the scrollbars. Note that although - # we must define the textArea first, we must pack it last, - # so that the bottomScrollbar will be located properly. - - # Note that we need a bottom scrollbar only for code. - # Text will be displayed with wordwrap, so we don't need to have - # a horizontal scroll for it. - - if not wrap_text: - bottomScrollbar.pack(side=tk.BOTTOM, fill=tk.X) - rightScrollbar.pack(side=tk.RIGHT, fill=tk.Y) - - self.textArea.pack(side=tk.LEFT, fill=tk.BOTH, expand=tk.YES) - - def create_buttons_frame(self): - - self.buttonsFrame = tk.Frame(self.boxRoot, - # background="green", - - ) - self.buttonsFrame.pack(side=tk.TOP) - - def create_cancel_button(self): - # put the buttons in the buttonsFrame - self.cancelButton = tk.Button( - self.buttonsFrame, takefocus=tk.YES, text="Cancel", - height=1, width=6) - self.cancelButton.pack( - expand=tk.NO, side=tk.LEFT, padx='2m', pady='1m', ipady="1m", - ipadx="2m") - - # for the commandButton, bind activation events to the activation event - # handler - self.cancelButton.bind("", self.cancel_pressed) - mouse_handlers = mouse_click_handlers(self.cancel_pressed) - for selectionEvent in global_state.STANDARD_SELECTION_EVENTS_MOUSE: - self.cancelButton.bind("<%s>" % selectionEvent, mouse_handlers[selectionEvent]) - - def create_ok_button(self): - # put the buttons in the buttonsFrame - self.okButton = tk.Button( - self.buttonsFrame, takefocus=tk.YES, text="OK", height=1, width=6) - self.okButton.pack( - expand=tk.NO, side=tk.LEFT, padx='2m', pady='1m', ipady="1m", - ipadx="2m") - - # for the commandButton, bind activation events to the activation event - # handler - self.okButton.bind("", self.ok_button_pressed) - mouse_handlers = mouse_click_handlers(self.ok_button_pressed) - for selectionEvent in global_state.STANDARD_SELECTION_EVENTS_MOUSE: - self.okButton.bind("<%s>" % selectionEvent, mouse_handlers[selectionEvent]) - - - -if __name__ == '__main__': - demo_textbox() diff --git a/easygui/boxes/utils.py b/easygui/boxes/utils.py deleted file mode 100644 index 93d358d..0000000 --- a/easygui/boxes/utils.py +++ /dev/null @@ -1,233 +0,0 @@ -""" - -.. moduleauthor:: easygui developers and Stephen Raymond Ferg -.. default-domain:: py -.. highlight:: python - -Version |release| - -""" - -import os -import sys -import traceback - -# A set of variables and functions to centralize differences between -# python 2 and 3 -runningPython27 = False -runningPython34 = False -if 0x020700F0 <= sys.hexversion <= 0x030000F0: - runningPython27 = True -if 0x030400F0 <= sys.hexversion <= 0x040000F0: - runningPython34 = True -if not runningPython27 and not runningPython34: - raise Exception("You must run on Python 2.7+ or Python 3.4+") - -# Import Tkinter, the tk filedialog, and put everything in tkinter into -# the current namespace -try: - import tkinter as tk # python3 - # TODO: Ultimately this should go away once everything stops using it. - from tkinter import * - import tkinter.filedialog as tk_FileDialog - import tkinter.font as tk_Font -except ImportError: - try: - import Tkinter as tk # python2 - # TODO: Ultimately this should go away once everything stops using it. - from Tkinter import * - import tkFileDialog as tk_FileDialog - import tkFont as tk_Font - - except ImportError: - raise ImportError("Unable to find tkinter package.") - -if tk.TkVersion < 8.0: - raise ImportError("You must use python-tk (tkinter) version 8.0 or higher") - - -# Try to import the Python Image Library. If it doesn't exist, only .gif -# images are supported. -try: - from PIL import Image as PILImage - from PIL import ImageTk as PILImageTk -except: - pass - -# Code should use 'basestring' anywhere you might think to use the system 'str'. This is all to support -# Python 2. If 2 ever goes away, this logic can go away and uses of -# utils.basestring should be changed to just str -if runningPython27: - basestring = basestring -if runningPython34: - basestring = str - - -# ----------------------------------------------------------------------- -# exception_format -# ----------------------------------------------------------------------- -def exception_format(): - """ - Convert exception info into a string suitable for display. - """ - return "".join(traceback.format_exception( - sys.exc_info()[0], sys.exc_info()[1], sys.exc_info()[2] - )) - - -# ------------------------------------------------------------------- -# utility routines -# ------------------------------------------------------------------- -# These routines are used by several other functions in the EasyGui module. - -def uniquify_list_of_strings(input_list): - """ - Ensure that every string within input_list is unique. - :param list input_list: List of strings - :return: New list with unique names as needed. - """ - output_list = list() - for i, item in enumerate(input_list): - tempList = input_list[:i] + input_list[i + 1:] - if item not in tempList: - output_list.append(item) - else: - output_list.append('{0}_{1}'.format(item, i)) - return output_list - -import re - - -def parse_hotkey(text): - """ - Extract a desired hotkey from the text. The format to enclose - the hotkey in square braces - as in Button_[1] which would assign the keyboard key 1 to that button. - The one will be included in the - button text. To hide they key, use double square braces as in: Ex[[qq]] - it , which would assign - the q key to the Exit button. Special keys such as may also be - used: Move [] for a full - list of special keys, see this reference: http://infohoglobal_state.nmt.edu/tcc/help/ - pubs/tkinter/web/key-names.html - :param text: - :return: list containing cleaned text, hotkey, and hotkey position within - cleaned text. - """ - - ret_val = [text, None, None] # Default return values - if text is None: - return ret_val - - # Single character, remain visible - res = re.search(r'(?<=\[).(?=\])', text) - if res: - start = res.start(0) - end = res.end(0) - caption = text[:start - 1] + text[start:end] + text[end + 1:] - ret_val = [caption, text[start:end], start - 1] - - # Single character, hide it - res = re.search(r'(?<=\[\[).(?=\]\])', text) - if res: - start = res.start(0) - end = res.end(0) - caption = text[:start - 2] + text[end + 2:] - ret_val = [caption, text[start:end], None] - - # a Keysym. Always hide it - res = re.search(r'(?<=\[\<).+(?=\>\])', text) - if res: - start = res.start(0) - end = res.end(0) - caption = text[:start - 2] + text[end + 2:] - ret_val = [caption, '<{}>'.format(text[start:end]), None] - - return ret_val - - -def load_tk_image(filename, tk_master=None): - """ - Load in an image file and return as a tk Image. - - Loads an image. If the PIL library is available use it. otherwise use the tk method. - - NOTE: tk_master is required if there are more than one Tk() instances, which there are very often. - REF: http://stackoverflow.com/a/23229091/2184122 - - :param filename: image filename to load - :param tk_master: root object (Tk()) - :return: tk Image object - """ - - if filename is None: - return None - - if not os.path.isfile(filename): - raise ValueError( - 'Image file {} does not exist.'.format(filename)) - - tk_image = None - - filename = os.path.normpath(filename) - _, ext = os.path.splitext(filename) - - try: - pil_image = PILImage.open(filename) - tk_image = PILImageTk.PhotoImage(pil_image, master=tk_master) - except: - try: - # Fallback if PIL isn't available - tk_image = tk.PhotoImage(file=filename, master=tk_master) - except: - msg = "Cannot load {}. Check to make sure it is an image file.".format( - filename) - try: - _ = PILImage - except: - msg += "\nPIL library isn't installed. If it isn't installed, only .gif files can be used." - raise ValueError(msg) - return tk_image - - -# ------------------------------------------------------------------- -# getFileDialogTitle -# ------------------------------------------------------------------- -def getFileDialogTitle(msg, title): - """ - Create nicely-formatted string based on arguments msg and title - :param msg: the msg to be displayed - :param title: the window title - :return: None - """ - if msg and title: - return "%s - %s" % (title, msg) - if msg and not title: - return str(msg) - if title and not msg: - return str(title) - return None # no message and no title - - -if __name__ == '__main__': - print("Hello from utils") - - -def mouse_click_handlers(callback): - ns = {"mouse_on_button": True} - - def handler_enter(event): - ns["mouse_on_button"] = True - - def handler_leave(event): - ns["mouse_on_button"] = False - - def handler_button(event): - if ns["mouse_on_button"]: - return callback(event) - - return None - - return {"Enter": handler_enter, - "Leave": handler_leave, - "ButtonRelease-1": handler_button} diff --git a/easygui/button_box.py b/easygui/button_box.py new file mode 100644 index 0000000..793484f --- /dev/null +++ b/easygui/button_box.py @@ -0,0 +1,367 @@ +import tkinter as tk + +from easygui.utilities import load_tk_image, get_width_and_padding, parse_hotkey + + +def buttonbox(msg="buttonbox options", title=" ", choices=("Button[1]", "Button[2]", "Button[3]"), + image=None, images=None, default_choice=None, cancel_choice=None, + callback=None, run=True): + """ Display a message, a title, an image, and a set of buttons. + The buttons are defined by the members of the choices argument. + :param str msg: the msg to be displayed + :param str title: the window title + :param tuple choices: a list or tuple of the choices to be displayed + :param str image: (Only here for backward compatibility) + :param str images: Filename of image or iterable or iteratable of iterable to display + :param str default_choice: The choice you want highlighted when the gui appears + :param cancel_choice: + :param callback: + :param run: + :return: the text of the button that the user selected OR the buttonbox object if run was False + """ + if image and images: + raise ValueError("Cannot run buttonbox() with both 'image' and 'images' - pick one!") + if image: + images = image + bb = ButtonBox( + msg=msg, + title=title, + choices=choices, + images=images, + default_choice=default_choice, + cancel_choice=cancel_choice, + callback=callback) + return bb.run() if run else bb + + +def boolbox(msg="[T]rue or [F]alse?", title=" ", choices=("[T]rue", "[F]alse"), image=None, + default_choice='[T]rue', cancel_choice='[F]alse'): + """ + Display a boolean dialog window with True/False options. + + The function returns `True` if the first button is selected, and returns + `False` if the second button is selected. The function returns `None` + if the user closes the dialog window. + + :param str msg: The message shown in the center of the dialog window. + :param str title: The window title text. + :param list choices: A list or tuple of strings for the buttons' text. + :param str image: The filename of an image to display in the dialog window. + :param str default_choice: The text of the default selected button. + :param str cancel_choice: If the user presses the 'X' close, which button + should be pressed + :return: `True` if first button pressed, `False` if second button is pressed, or None if the window was cancelled. + """ + + if len(choices) != 2: + raise AssertionError('boolbox takes exactly 2 choices! Consider using indexbox instead') + + reply = buttonbox(msg, title, choices, image, default_choice=default_choice, cancel_choice=cancel_choice) + if reply == choices[0]: + return True # The first button (True) was selected. + elif reply == choices[1]: + return False # The second button (False) was selected. + elif reply is None: + return None # The window was closed. + + +def ynbox(msg="Yes or No ?", title=" ", choices=("[]Yes", "[]No"), image=None, + default_choice='[]Yes', cancel_choice='[]No'): + """ + The ``ynbox()`` offers a choice of Yes and No, and returns either ``True`` or ``False``. + + import easygui + result = easygui.ynbox('Is a hot dog a sandwich?', 'Hot Dog Question') + if result == True: + easygui.msgbox('That is an interesting answer.') + else: + easygui.msgbox('Well, that is your opinion.') + + :param msg: the msg to be displayed + :param str title: the window title + :param list choices: a list or tuple of the choices to be displayed + :param str image: Filename of image to display + :param str default_choice: The choice you want highlighted when the gui appears + :param str cancel_choice: If the user presses the 'X' close, which button should be pressed + :return: True if 'Yes', False if 'No', None if dialog was cancelled + """ + return boolbox(msg, title, choices, image, default_choice=default_choice, cancel_choice=cancel_choice) + + +def ccbox(msg="C[o]ntinue or C[a]ncel?", title=" ", choices=("C[o]ntinue", "C[a]ncel"), image=None, + default_choice='C[o]ntinue', cancel_choice='C[a]ncel'): + """ + The ``ccbox()`` function offers a choice of Continue (returns True) and Cancel (returns False) + + import easygui + if easygui.ccbox("Do you want to continue?", "Please Confirm"): + pass # User chose Continue. + else: # User chose Cancel. + sys.exit() + + :param str msg: the msg to be displayed + :param str title: the window title + :param list choices: a list or tuple of the choices to be displayed + :param str image: Filename of image to display + :param str default_choice: The choice you want highlighted when the gui appears + :param str cancel_choice: If the user presses the 'X' close, which button should be pressed + :return: True if 'Continue' or dialog is cancelled, False if 'Cancel' + """ + return boolbox(msg, title, choices, image, default_choice=default_choice, cancel_choice=cancel_choice) + + +def indexbox(msg="Options: ", title=" ", choices=("Door 1", "Door 2", "Door 3"), image=None, + default_choice='Door 1', cancel_choice='Door 3'): + """ + The ``indexbox()`` function displays a set of buttons, and returns the + index of the selected button. For example, if you invoked index box with + three choices (A, B, C), indexbox would return 0 if the user picked A, 1 + if he picked B, and 2 if he picked C. + + import easygui + result = easygui.indexbox('Which door do you choose?', 'Win Prizes!', choices=['Door 1', 'Door 2', 'Door 3']) + if result == 2: + easygui.msgbox('You win a new car!') + else: + easygui.msgbox('Better luck next time.') + + :param str msg: the msg to be displayed + :param str title: the window title + :param list choices: a list or tuple of the choices to be displayed + :param str image: Filename of image to display + :param str default_choice: The choice you want highlighted when the gui appears + :param str cancel_choice: If the user presses the 'X' close, which button should be pressed + :return: the index of the choice selected, starting from 0 + """ + reply = buttonbox(msg, title, choices, image, default_choice=default_choice, cancel_choice=cancel_choice) + try: + return list(choices).index(reply) + except ValueError: + msg = ("EasyGui indexbox could not determine the index of choice {} in choices {}.".format(reply, choices)) + raise AssertionError(msg) + + +def msgbox(msg="(Your message goes here)", title=" ", ok_button="OK", image=None): + """ + The ``msgbox()`` function displays a text message and offers an OK + button. The message text appears in the center of the window, the title + text appears in the title bar, and you can replace the "OK" default text + on the button. Here is the signature:: + + def msgbox(msg="(Your message goes here)", title="", ok_button="OK"): + .... + + The clearest way to override the button text is to do it with a keyword + argument, like this:: + + easygui.msgbox("Backup complete!", ok_button="Good job!") + + Here are a couple of examples:: + + easygui.msgbox("Hello, world!") + + :param str msg: the msg to be displayed + :param str title: the window title + :param str ok_button: text to show in the button + :param str image: Filename of image to display + :return: the text of the ok_button + """ + return buttonbox(msg, title, choices=[ok_button], image=image, default_choice=ok_button, cancel_choice=ok_button) + + +class ButtonBox(object): + """ Display various types of button boxes + + This object separates user from ui, defines which methods can + the user invoke and which properties can he change. + """ + + def __init__(self, msg, title, choices, images, default_choice, cancel_choice, callback): + """ Create box object + + Parameters + ---------- + msg : string + text displayed in the message area (instructions...) + title : str + the window title + choices : iterable of strings + build a button for each string in choices + images : iterable of filenames, or an iterable of iterables of filenames + displays each image + default_choice : string + one of the strings in choices to be the default selection + cancel_choice : string + if X or is pressed, it appears as if this button was pressed. + callback: function + if set, this function will be called when any button is pressed. + + """ + + self._user_specified_callback = callback + self._text_to_return_on_cancel = cancel_choice + + self.choice_text = None + + self._images = [] + self._buttons = [] + + self.box_root = self._configure_box_root(title) + self.message_area = self._configure_message_area(box_root=self.box_root) + self._set_msg_area('' if msg is None else msg) + self.images_frame = self._create_images_frame(images) + self.buttons_frame = self._create_buttons_frame(choices, default_choice) + + def _configure_box_root(self, title): + box_root = tk.Tk() + box_root.title(title) + box_root.iconname('Dialog') + box_root.geometry('600x400+100+100') + box_root.protocol('WM_DELETE_WINDOW', self._x_pressed) # Quit when x button pressed + box_root.bind("", self._cancel_button_pressed) + return box_root + + @staticmethod + def _configure_message_area(box_root): + padding, width_in_chars = get_width_and_padding(monospace=False) + message_frame = tk.Frame(box_root, padx=padding) + message_frame.grid() + message_area = tk.Text(master=message_frame, width=width_in_chars, padx=padding, pady=padding, wrap=tk.WORD) + message_area.grid() + return message_area + + def _set_msg_area(self, msg): + self.message_area.delete(1.0, tk.END) + self.message_area.insert(tk.END, msg) + num_lines, _ = self.message_area.index(tk.END).split('.') + self.message_area.configure(height=int(num_lines)) + self.message_area.update() + + @staticmethod + def _convert_to_a_list_of_lists(filenames): + """ return a list of lists, handling all of the different allowed types of 'filenames' input """ + if type(filenames) is str: + return [[filenames, ], ] + elif type(filenames[0]) is str: + return [filenames, ] + elif type(filenames[0][0]) is str: + return filenames + raise ValueError("Incorrect images argument.") + + def _create_images_frame(self, filenames): + images_frame = tk.Frame(self.box_root) + row = 1 + images_frame.grid(row=row) + self.box_root.rowconfigure(row, weight=10, minsize='10m') + + if filenames is None: + return + + filename_array = self._convert_to_a_list_of_lists(filenames) + for row, list_of_filenames in enumerate(filename_array): + for column, filename in enumerate(list_of_filenames): + try: + tk_image = load_tk_image(filename, tk_master=images_frame) + except Exception as e: + print(e) + tk_image = None + widget = tk.Button( + master=images_frame, + takefocus=1, + compound=tk.TOP, + image=tk_image, + command=lambda text=filename: self._button_pressed(text) + ) + widget.grid(row=row, column=column, sticky=tk.NSEW, padx='1m', pady='1m', ipadx='2m', ipady='1m') + + image = {'tk_image': tk_image, 'widget': widget} + images_frame.rowconfigure(row, weight=10, minsize='10m') + images_frame.columnconfigure(column, weight=10) + self._images.append(image) # Prevent image deletion by keeping them on self + return images_frame + + def _create_buttons_frame(self, choices, default_choice): + buttons_frame = tk.Frame(self.box_root) + buttons_frame.grid(row=2) + + for column, button_text in enumerate(choices): + clean_text, hotkey, hotkey_position = parse_hotkey(button_text) + widget = tk.Button( + master=buttons_frame, + takefocus=1, + text=clean_text, + underline=hotkey_position, + command=lambda text=button_text: self._button_pressed(text) + ) + widget.grid(row=0, column=column, padx='1m', pady='1m', ipadx='2m', ipady='1m') + button = { + 'original_text': button_text, + 'clean_text': clean_text, + 'hotkey': hotkey, + 'widget': widget + } + buttons_frame.columnconfigure(column, weight=10) + self._buttons.append(button) + + for button in self._buttons: + if button['original_text'] == default_choice: + button['widget'].focus_force() + + if button['hotkey'] is not None: + self.box_root.bind_all(button['hotkey'], lambda e: self._hotkey_pressed(e), add=True) + + return buttons_frame + + def _callback(self, command): + if command == 'update': # OK was pressed + if self._user_specified_callback: + # If a callback was set, call main process + self._user_specified_callback() + else: + self.stop() + elif command in ('x', 'cancel'): + self.stop() + + def run(self): + self.box_root.mainloop() + self.box_root.destroy() + return self.choice_text + + def stop(self): + self.box_root.quit() + + # Methods executing when a key is pressed + def _x_pressed(self): + self._callback(command='x') + self.choice_text = self._text_to_return_on_cancel + + def _cancel_button_pressed(self, _): + self._callback(command='cancel') + self.choice_text = self._text_to_return_on_cancel + + def _button_pressed(self, button_text): + self._callback(command='update') + self.choice_text = button_text + + def _hotkey_pressed(self, event=None): + """ Handle an event that is generated by a person interacting with a button """ + if event.keysym != event.char: # A special character + hotkey_pressed = '<{}>'.format(event.keysym) + else: + hotkey_pressed = event.keysym + + for button in self._buttons: + if button['hotkey'] == hotkey_pressed: + self._callback(command='update') + self.choice_text = button['original_text'] + + return # some key was pressed, but no hotkey registered to it + + +if __name__ == '__main__': + buttonbox() + boolbox() + ynbox() + ccbox() + indexbox() + msgbox() diff --git a/easygui/choice_box.py b/easygui/choice_box.py new file mode 100644 index 0000000..6d2a14c --- /dev/null +++ b/easygui/choice_box.py @@ -0,0 +1,324 @@ +import string +import tkinter as tk + +from easygui.utilities import get_num_lines, get_width_and_padding, bindArrows, MouseClickHandler + + +def choicebox(msg="Pick an item", title="", choices=None, preselect=[], callback=None, run=True): + """ + Present the user with a list of choices. + return the choice that he selects. + + :param str msg: the msg to be displayed + :param str title: the window title + :param list choices: a list or tuple of the choices to be displayed + :param preselect: optional list of pre-selected choices, a subset of the choices argument + :param callback: + :param run: + :return: List containing choice selected or None if cancelled + """ + cb = ChoiceBox(msg, title, choices, preselect=preselect, multiple_select=False, callback=callback) + if run: + reply = cb.run() + return reply + else: + return cb + + +def multchoicebox(msg="Pick an item", title="", choices=None, preselect=[], callback=None, run=True): + """ + The ``multchoicebox()`` function provides a way for a user to select + from a list of choices. The interface looks just like the ``choicebox()`` + function's dialog box, but the user may select zero, one, or multiple choices. + + The choices are specified in a sequence (a tuple or a list). + + import easygui + msg ="What is your favorite flavor?" + title = "Ice Cream Survey" + choices = ["Vanilla", "Chocolate", "Strawberry", "Rocky Road"] + choice = easygui.multchoicebox(msg, title, choices) + + + :param str msg: the msg to be displayed + :param str title: the window title + :param list choices: a list or tuple of the choices to be displayed + :param preselect: Which item, if any are preselected when dialog appears + :return: A list of strings of the selected choices or None if cancelled. + """ + mcb = ChoiceBox(msg, title, choices, preselect=preselect, multiple_select=True, callback=callback) + if run: + reply = mcb.run() + return reply + else: + return mcb + + +class ChoiceBox(object): + + def __init__(self, msg, title, choices, preselect, multiple_select, callback): + + if not multiple_select and len(preselect)>1: + raise ValueError("Multiple selections not allowed, yet preselect has multiple values:{}".format(preselect)) + + self._multiple_select = multiple_select + self._user_specified_callback = callback + if choices is None: + # Use default choice selections if none were specified: + choices = ('Choice 1', 'Choice 2') + self.choices = [str(c) for c in choices] + + self.box_root = self._configure_box_root(title) + + self.message_area = self._configure_message_area(self.box_root) + self._set_msg_area("" if msg is None else msg) + + self.create_choice_area() + + self.create_ok_button() + self.create_cancel_button() + self.create_special_buttons() + self.preselect_choice(preselect) + self.choiceboxWidget.focus_force() + + def run(self): + self.box_root.mainloop() # run it! + self.box_root.destroy() # close the window + return self.choices + + def stop(self): + self.box_root.quit() + + def x_pressed(self): + self.stop() + self.choices = None + + def cancel_button_pressed(self, event): + self.stop() + self.choices = None + + def ok_button_pressed(self, event): + self.choices = self.get_choices() + if self._user_specified_callback: + # If a _user_specified_callback was set, call main process + self._user_specified_callback(self) + else: + self.stop() + + def _set_msg_area(self, msg): + self.message_area.config(state=tk.NORMAL) # necessary but I don't know why + self.message_area.delete(1.0, tk.END) + self.message_area.insert(tk.END, msg) + numlines = get_num_lines(self.message_area) + self.message_area.configure(height=numlines) + self.message_area.update() + + def preselect_choice(self, preselect): + if preselect != None: + for v in preselect: + self.choiceboxWidget.select_set(v) + self.choiceboxWidget.activate(v) + + def get_choices(self): + choices_index = self.choiceboxWidget.curselection() + if not choices_index: + return None + if self._multiple_select: + selected_choices = [self.choiceboxWidget.get(index) + for index in choices_index] + else: + selected_choices = self.choiceboxWidget.get(choices_index) + + return selected_choices + + def _configure_box_root(self, title): + box_root = tk.Tk() + box_root.title(title) + box_root.iconname('Dialog') + box_root.protocol('WM_DELETE_WINDOW', self.x_pressed) + box_root.bind('', self.KeyboardListener) + box_root.bind("", self.cancel_button_pressed) + return box_root + + @staticmethod + def _configure_message_area(box_root): + padding, width_in_chars = get_width_and_padding(monospace=False) + + message_frame = tk.Frame(box_root, padx=padding) + message_frame.pack(side=tk.TOP, expand=1, fill='both') + + message_area = tk.Text(master=message_frame, + width=width_in_chars, + state=tk.DISABLED, + background=box_root.config()["background"][-1], + relief='flat', + padx=padding, + pady=padding, + wrap=tk.WORD) + message_area.pack(side=tk.TOP, expand=1, fill='both') + return message_area + + def create_choice_area(self): + + self.choiceboxFrame = tk.Frame(master=self.box_root) + self.choiceboxFrame.pack(side=tk.TOP, fill=tk.BOTH, expand=tk.YES) + + lines_to_show = min(len(self.choices), 20) + + # -------- put the self.choiceboxWidget in the self.choiceboxFrame --- + self.choiceboxWidget = tk.Listbox(self.choiceboxFrame, + height=lines_to_show, + borderwidth="1m", relief="flat", + bg="white" + ) + + if self._multiple_select: + self.choiceboxWidget.configure(selectmode=tk.MULTIPLE) + + # self.choiceboxWidget.configure(font=(global_state.PROPORTIONAL_FONT_FAMILY, + # global_state.PROPORTIONAL_FONT_SIZE)) + + # add a vertical scrollbar to the frame + rightScrollbar = tk.Scrollbar(self.choiceboxFrame, orient=tk.VERTICAL, + command=self.choiceboxWidget.yview) + self.choiceboxWidget.configure(yscrollcommand=rightScrollbar.set) + + # add a horizontal scrollbar to the frame + bottomScrollbar = tk.Scrollbar(self.choiceboxFrame, + orient=tk.HORIZONTAL, + command=self.choiceboxWidget.xview) + self.choiceboxWidget.configure(xscrollcommand=bottomScrollbar.set) + + # pack the Listbox and the scrollbars. + # Note that although we must define + # the textArea first, we must pack it last, + # so that the bottomScrollbar will + # be located properly. + + bottomScrollbar.pack(side=tk.BOTTOM, fill=tk.X) + rightScrollbar.pack(side=tk.RIGHT, fill=tk.Y) + + self.choiceboxWidget.pack( + side=tk.LEFT, padx="1m", pady="1m", expand=tk.YES, fill=tk.BOTH) + + # Insert choices widgets + for choice in self.choices: + self.choiceboxWidget.insert(tk.END, choice) + + # Bind the keyboard events + self.choiceboxWidget.bind("", self.ok_button_pressed) + self.choiceboxWidget.bind("", + self.ok_button_pressed) + + def create_ok_button(self): + + self.buttonsFrame = tk.Frame(self.box_root) + self.buttonsFrame.pack(side=tk.TOP, expand=tk.YES, pady=0) + + # put the buttons in the self.buttonsFrame + okButton = tk.Button(self.buttonsFrame, takefocus=tk.YES, + text="OK", height=1, width=6) + bindArrows(okButton) + okButton.pack(expand=tk.NO, side=tk.RIGHT, padx='2m', pady='1m', + ipady="1m", ipadx="2m") + + # for the commandButton, bind activation events + okButton.bind("", self.ok_button_pressed) + okButton.bind("", self.ok_button_pressed) + + ok_click_handler = MouseClickHandler(callback=self.ok_button_pressed) + okButton.bind("", ok_click_handler.enter) + okButton.bind("", ok_click_handler.leave) + okButton.bind("", ok_click_handler.release) + + def create_cancel_button(self): + cancelButton = tk.Button(self.buttonsFrame, takefocus=tk.YES, + text="Cancel", height=1, width=6) + bindArrows(cancelButton) + cancelButton.pack(expand=tk.NO, side=tk.LEFT, padx='2m', pady='1m', + ipady="1m", ipadx="2m") + cancelButton.bind("", self.cancel_button_pressed) + + cancel_click_handler = MouseClickHandler(callback=self.cancel_button_pressed) + cancelButton.bind("", cancel_click_handler.enter) + cancelButton.bind("", cancel_click_handler.leave) + cancelButton.bind("", cancel_click_handler.release) + + def create_special_buttons(self): + # add special buttons for multiple select features + if not self._multiple_select: + return + + selectAllButton = tk.Button( + self.buttonsFrame, text="Select All", height=1, width=6) + selectAllButton.pack(expand=tk.NO, side=tk.LEFT, padx='2m', + pady='1m', + ipady="1m", ipadx="2m") + + clearAllButton = tk.Button(self.buttonsFrame, text="Clear All", + height=1, width=6) + clearAllButton.pack(expand=tk.NO, side=tk.LEFT, + padx='2m', pady='1m', + ipady="1m", ipadx="2m") + + selectAllButton.bind("", self.choiceboxSelectAll) + bindArrows(selectAllButton) + clearAllButton.bind("", self.choiceboxClearAll) + bindArrows(clearAllButton) + + def KeyboardListener(self, event): + key = event.keysym + if len(key) <= 1: + if key in string.printable: + # Find the key in the liglobal_state. + # before we clear the list, remember the selected member + try: + start_n = int(self.choiceboxWidget.curselection()[0]) + except IndexError: + start_n = -1 + + # clear the selection. + self.choiceboxWidget.selection_clear(0, 'end') + + # start from previous selection +1 + for n in range(start_n + 1, len(self.choices)): + item = self.choices[n] + if item[0].lower() == key.lower(): + self.choiceboxWidget.selection_set(first=n) + self.choiceboxWidget.see(n) + return + else: + # has not found it so loop from top + for n, item in enumerate(self.choices): + if item[0].lower() == key.lower(): + self.choiceboxWidget.selection_set(first=n) + self.choiceboxWidget.see(n) + return + + # nothing matched -- we'll look for the next logical choice + for n, item in enumerate(self.choices): + if item[0].lower() > key.lower(): + if n > 0: + self.choiceboxWidget.selection_set( + first=(n - 1)) + else: + self.choiceboxWidget.selection_set(first=0) + self.choiceboxWidget.see(n) + return + + # still no match (nothing was greater than the key) + # we set the selection to the first item in the list + lastIndex = len(self.choices) - 1 + self.choiceboxWidget.selection_set(first=lastIndex) + self.choiceboxWidget.see(lastIndex) + return + + def choiceboxClearAll(self, event): + self.choiceboxWidget.selection_clear(0, len(self.choices) - 1) + + def choiceboxSelectAll(self, event): + self.choiceboxWidget.selection_set(0, len(self.choices) - 1) + +if __name__ == '__main__': + users_choice = multchoicebox(choices=['choice1', 'choice2']) + print("User's choice is: {}".format(users_choice)) diff --git a/easygui/easygui.py b/easygui/easygui.py deleted file mode 100644 index 9d050be..0000000 --- a/easygui/easygui.py +++ /dev/null @@ -1,86 +0,0 @@ -""" - -.. moduleauthor:: easygui developers and Stephen Raymond Ferg -.. default-domain:: py -.. highlight:: python - -Version |release| - -ABOUT EASYGUI -============= - -EasyGUI provides an easy-to-use interface for simple GUI interaction -with a user. It does not require the programmer to know anything about -tkinter, frames, widgets, callbacks or lambda. All GUI interactions are -invoked by simple function calls that return results. - -.. warning:: Using EasyGUI with IDLE - - You may encounter problems using IDLE to run programs that use EasyGUI. Try it - and find out. EasyGUI is a collection of Tkinter routines that run their own - event loops. IDLE is also a Tkinter application, with its own event loop. The - two may conflict, with unpredictable results. If you find that you have - problems, try running your EasyGUI program outside of IDLE. - -.. note:: EasyGUI requires Tk release 8.0 or greater. - -LICENSE INFORMATION -=================== -EasyGUI version |version| - -Copyright (c) 2014, Stephen Raymond Ferg - -All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, -are permitted provided that the following conditions are met: - - 1. Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. - - 2. Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation and/or - other materials provided with the distribution. - - 3. The name of the author may not be used to endorse or promote products derived - from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" -AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, -INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, -STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING -IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, -EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - - -ABOUT THE EASYGUI LICENSE -------------------------- -| This license is what is generally known as the "modified BSD license", -| aka "revised BSD", "new BSD", "3-clause BSD". -| See http://www.opensource.org/licenses/bsd-license.php -| -| This license is GPL-compatible. -| See ``_ -| See http://www.gnu.org/licenses/license-liglobal_state.html#GPLCompatibleLicenses -| -| The BSD License is less restrictive than GPL. -| It allows software released under the license to be incorporated into proprietary products. -| Works based on the software may be released under a proprietary license or as closed source software. -| ``_ - -API -=== -""" - - -if __name__ == '__main__': - from boxes.demo import easygui_demo - easygui_demo() - - # from boxes.alt_text_box import demo_textbox - # demo_textbox() diff --git a/easygui/boxes/egstore.py b/easygui/egstore.py similarity index 100% rename from easygui/boxes/egstore.py rename to easygui/egstore.py diff --git a/easygui/file_boxes.py b/easygui/file_boxes.py new file mode 100644 index 0000000..4b09078 --- /dev/null +++ b/easygui/file_boxes.py @@ -0,0 +1,51 @@ +from os.path import normpath + +from tkinter import filedialog + + +def diropenbox(title='Open', default_directory=None): + """ + A dialog to get a directory name. + + Returns the name of a directory, or None if user chose to cancel. + + If the "default" argument specifies a directory name, and that + directory exists, then the dialog box will start with that directory. + + :param str msg: used in the window title + :param str msg: used in the window title on some platforms + :param str title: the window title + :param str default: starting directory when dialog opens + :return: Normalized path selected by user + """ + directory_path = filedialog.askdirectory(title=title, initialdir=default_directory) + return None if directory_path is None else normpath(directory_path) + + +def filesavebox(title='Save As', default_directory="", filetypes=None): + """A dialog box to get the name of a file. Return the name of a file, or None if user chose to cancel """ + file_path = filedialog.asksaveasfilename(title=title, initialdir=default_directory, filetypes=filetypes) + return None if file_path is None else normpath(file_path) + + +def fileopenbox(title='Open', default_directory='*', filetypes=(), multiple=False): + """ A dialog to get a file name. + fileopenbox automatically changes the path separator to backslash on Windows. + + :param str title: the window title + :param str default_directory: filepath to search, may contain wildcards, defaults to all files in current directory + :param object filetypes: a file pattern OR a list of file patterns and a file type description + eg. ["*.css", ["*.htm", "*.html", "HTML files"] ] + If the filetypes list does not contain ("All files","*"), it will be added. + :param bool multiple: allow selection of more than one file + :return: the name of a file, or None if user chose to cancel + """ + kwargs = dict(title=title, initialdir=default_directory, filetypes=filetypes) + + if multiple: + filenames = filedialog.askopenfilenames(**kwargs) + return None if filenames is None else [normpath(x) for x in filenames] + + else: + filename = filedialog.askopenfilename(**kwargs) + return None if filename is None else normpath(filename) diff --git a/easygui/fillable_box.py b/easygui/fillable_box.py new file mode 100644 index 0000000..514702c --- /dev/null +++ b/easygui/fillable_box.py @@ -0,0 +1,207 @@ +import tkinter as tk + +from easygui import msgbox +from easygui.global_state import GLOBAL_WINDOW_POSITION, PROPORTIONAL_FONT_FAMILY, PROPORTIONAL_FONT_SIZE, \ + TEXT_ENTRY_FONT_SIZE +from easygui.utilities import load_tk_image, bindArrows, MouseClickHandler + + +def integerbox(msg=None, title=" ", default=None, lowerbound=0, upperbound=99, image=None, root=None): + """ + Show a box in which a user can enter an integer. + + In addition to arguments for msg and title, this function accepts + integer arguments for "default", "lowerbound", and "upperbound". + + The default, lowerbound, or upperbound may be None. + + When the user enters some text, the text is checked to verify that it + can be converted to an integer between the lowerbound and upperbound. + + If it can be, the integer (not the text) is returned. + + If it cannot, then an error msg is displayed, and the integerbox is + redisplayed. + + If the user cancels the operation, None is returned. + + :param str msg: the msg to be displayed + :param str title: the window title + :param int default: The default value to return + :param int lowerbound: The lower-most value allowed + :param int upperbound: The upper-most value allowed + :param str image: Filename of image to display + :param tk_widget root: Top-level Tk widget + :return: the integer value entered by the user + """ + msg = "Enter an integer between {0} and {1}".format(lowerbound, upperbound) if msg is None else msg + + while True: + result = FillableBox(msg, title, default, image=image, root=root).run() + if result is None: + return None + + try: + result = int(result) + except ValueError: + msgbox('The value that you entered:\n\t"{}"\nis not an integer.'.format(result), "Error") + continue + + if lowerbound and result < int(lowerbound): + msgbox('The value that you entered is less than the lower bound of {}.'.format(lowerbound), "Error") + elif upperbound and result > int(upperbound): + msgbox('The value that you entered is greater than the upper bound of {}.'.format(upperbound), "Error") + else: + return result # validation passed! + + +def enterbox(msg="Enter something.", title=" ", default="", strip=True, image=None, root=None): + """ + Show a box in which a user can enter some text. + + You may optionally specify some default text, which will appear in the + enterbox when it is displayed. + + Example:: + + import easygui + reply = easygui.enterbox('Enter your life story:') + if reply: + easygui.msgbox('Thank you for your response.') + else: + easygui.msgbox('Your response has been discarded.') + + :param str msg: the msg to be displayed. + :param str title: the window title + :param str default: value returned if user does not change it + :param bool strip: If True, the return value will have + its whitespace stripped before being returned + :return: the text that the user entered, or None if they cancel + the operation. + """ + result = FillableBox(msg, title, default, image=image, root=root).run() + if result and strip: + result = result.strip() + return result + + +def passwordbox(msg="Enter your password.", title="", default="", image=None, root=None): + """ + Show a box in which a user can enter a password. + The text is masked with asterisks, so the password is not displayed. + + :param str msg: the msg to be displayed. + :param str title: the window title + :param str default: value returned if user does not change it + :return: the text that the user entered, or None if they cancel + the operation. + """ + return FillableBox(msg, title, default, mask="*", image=image, root=root).run() + + +def fillablebox(msg, title="", default=None, mask=None, image=None, root=None): + """ + Show a box in which a user can enter some text. + :param str msg: the msg to be displayed. + :param str title: the window title + :param str default: default value populated, returned if user does not change it + :return: the text that the user entered, or None if he cancels the operation. + """ + return FillableBox(msg, title, default, mask, image, root).run() + + +class FillableBox(object): + def __init__(self, msg, default, title, mask=None, image=None, root=None): + self.return_value = '' if default is None else default + self.pre_existing_root = root + self.box_root = None + self.entry_widget = None + + if root: + root.withdraw() + self.box_root = tk.Toplevel(master=root) + self.box_root.withdraw() + else: + self.box_root = tk.Tk() + self.box_root.withdraw() + + self.box_root.protocol('WM_DELETE_WINDOW', self._cancel_pressed) + self.box_root.title(title) + self.box_root.iconname('Dialog') + self.box_root.geometry(GLOBAL_WINDOW_POSITION) + self.box_root.bind("", self._cancel_pressed) + + message_frame = tk.Frame(master=self.box_root) + message_frame.pack(side=tk.TOP, fill=tk.BOTH) + + try: + tk_image = load_tk_image(image) + except Exception as e: + print(e) + tk_image = None + if tk_image: + image_frame = tk.Frame(master=self.box_root) + image_frame.pack(side=tk.TOP, fill=tk.BOTH) + label = tk.Label(image_frame, image=tk_image) + label.image = tk_image # keep a reference! + label.pack(side=tk.TOP, expand=tk.YES, fill=tk.X, padx='1m', pady='1m') + + buttons_frame = tk.Frame(master=self.box_root) + buttons_frame.pack(side=tk.TOP, fill=tk.BOTH) + + entry_frame = tk.Frame(master=self.box_root) + entry_frame.pack(side=tk.TOP, fill=tk.BOTH) + + buttons_frame = tk.Frame(master=self.box_root) + buttons_frame.pack(side=tk.TOP, fill=tk.BOTH) + + message_widget = tk.Message(message_frame, width="4.5i", text=msg) + message_widget.configure(font=(PROPORTIONAL_FONT_FAMILY, PROPORTIONAL_FONT_SIZE)) + message_widget.pack(side=tk.RIGHT, expand=1, fill=tk.BOTH, padx='3m', pady='3m') + + entry_widget = tk.Entry(entry_frame, width=40) + entry_widget.configure(font=(PROPORTIONAL_FONT_FAMILY, TEXT_ENTRY_FONT_SIZE)) + if mask: + entry_widget.configure(show=mask) + entry_widget.pack(side=tk.LEFT, padx="3m") + entry_widget.bind("", self._ok_pressed) + entry_widget.bind("", self._cancel_pressed) + entry_widget.insert(0, self.return_value) # put text into the entry_widget + self.entry_widget = entry_widget # save a reference - we need to get text from this widget later + + ok_button = tk.Button(buttons_frame, takefocus=1, text="OK") + bindArrows(ok_button) + ok_button.pack(expand=1, side=tk.LEFT, padx='3m', pady='3m', ipadx='2m', ipady='1m') + ok_button.bind("", self._ok_pressed) + ok_click_handler = MouseClickHandler(callback=self._ok_pressed) + ok_button.bind("", ok_click_handler.enter) + ok_button.bind("", ok_click_handler.leave) + ok_button.bind("", ok_click_handler.release) + + cancel_button = tk.Button(buttons_frame, takefocus=1, text="Cancel") + cancel_button.pack(expand=1, side=tk.RIGHT, padx='3m', pady='3m', ipadx='2m', ipady='1m') + cancel_button.bind("", self._cancel_pressed) + cancel_click_handler = MouseClickHandler(callback=self._cancel_pressed) + cancel_button.bind("", cancel_click_handler.enter) + cancel_button.bind("", cancel_click_handler.leave) + cancel_button.bind("", cancel_click_handler.release) + + self.entry_widget.focus_force() # put the focus on the self.entry_widget + self.box_root.deiconify() + + def _cancel_pressed(self, *args): + self.return_value = None + self.box_root.quit() + + def _ok_pressed(self, *args): + self.return_value = self.entry_widget.get() + self.box_root.quit() + + def run(self): + self.box_root.mainloop() # run it! + + # -------- after the run has completed ---------------------------------- + if self.pre_existing_root: + self.pre_existing_root.deiconify() + self.box_root.destroy() # button_click didn't destroy self.boxRoot, so we do it now + return self.return_value diff --git a/easygui/global_state.py b/easygui/global_state.py new file mode 100644 index 0000000..d208bbc --- /dev/null +++ b/easygui/global_state.py @@ -0,0 +1,14 @@ +GLOBAL_WINDOW_POSITION = "+300+200" +PROPORTIONAL_FONT_FAMILY = ("MS", "Sans", "Serif") + +PROPORTIONAL_FONT_SIZE = 10 +TEXT_ENTRY_FONT_SIZE = 12 # a little larger makes it easier to see + +PROP_FONT_LINE_LENGTH = 62 +FIXW_FONT_LINE_LENGTH = 80 + +DEFAULT_PADDING = 2 +REGULAR_FONT_WIDTH = 13 +FIXED_FONT_WIDTH = 7 +boxRoot = None + diff --git a/easygui/multi_fillable_box.py b/easygui/multi_fillable_box.py new file mode 100644 index 0000000..d4fca16 --- /dev/null +++ b/easygui/multi_fillable_box.py @@ -0,0 +1,118 @@ +import tkinter as tk + +from easygui.global_state import GLOBAL_WINDOW_POSITION, PROPORTIONAL_FONT_FAMILY, PROPORTIONAL_FONT_SIZE, \ + TEXT_ENTRY_FONT_SIZE +from easygui.utilities import MouseClickHandler + + +def multpasswordbox(msg="Fill in values for the fields.", title=" ", fields=None, values=None, callback=None, run=True): + """ + Show dialog box with multiple data entry fields. + The last of the fields is assumed to be a password, and is masked with asterisks. + + :param str msg: the msg to be displayed. + :param str title: the window title + :param list fields: a list of fieldnames. + :param list values: a list of field values + :return: String + """ + mb = MultiBox(msg, title, fields, values, mask_last=True, callback=callback) + return mb.run() if run else mb + + +def multenterbox(msg="Fill in values for the fields.", title=" ", fields=None, values=None, callback=None, run=True): + """ + Show dialog box with multiple data entry fields. + + :param str msg: the msg to be displayed. + :param str title: the window title + :param list fields: a list of fieldnames. + :param list values: a list of field values + :return: String + """ + mb = MultiBox(msg, title, fields, values, mask_last=False, callback=callback) + return mb.run() if run else mb + + +class MultiBox(object): + def __init__(self, msg, title, fields=None, values=None, mask_last=False, callback=None): + self.fields, self.values = self._process_fields_and_values(fields, values) + self.user_defined_callback = callback + + self.boxRoot = tk.Tk() + self.boxRoot.protocol('WM_DELETE_WINDOW', self._cancel_pressed) + self.boxRoot.title(title) + self.boxRoot.iconname('Dialog') + self.boxRoot.bind("", self._cancel_pressed) + self.boxRoot.geometry(GLOBAL_WINDOW_POSITION) + + message_widget = tk.Message(self.boxRoot, width="4.5i", text=msg) + message_widget.configure(font=(PROPORTIONAL_FONT_FAMILY, PROPORTIONAL_FONT_SIZE)) + message_widget.pack(side=tk.TOP, expand=1, fill=tk.BOTH, padx='3m', pady='3m') + + self.entry_widgets = [] + for field, value in zip(self.fields, self.values): + entry_frame = tk.Frame(master=self.boxRoot) + entry_frame.pack(side=tk.TOP, fill=tk.BOTH) + + label_widget = tk.Label(entry_frame, text=field) + label_widget.pack(side=tk.LEFT) + + entry_widget = tk.Entry(entry_frame, width=40, highlightthickness=2) + self.entry_widgets.append(entry_widget) + entry_widget.configure(font=(PROPORTIONAL_FONT_FAMILY, TEXT_ENTRY_FONT_SIZE)) + entry_widget.pack(side=tk.RIGHT, padx="3m") + entry_widget.bind("", self._ok_pressed) + entry_widget.bind("", self._cancel_pressed) + entry_widget.insert(0, '' if value is None else value) + + if mask_last: + self.entry_widgets[-1].configure(show="*") + + buttons_frame = tk.Frame(master=self.boxRoot) + buttons_frame.pack(side=tk.BOTTOM) + + cancel_button = tk.Button(buttons_frame, takefocus=1, text="Cancel") + cancel_button.pack(expand=1, side=tk.LEFT, padx='3m', pady='3m', ipadx='2m', ipady='1m') + cancel_button.bind("", self._cancel_pressed) + cancel_click_handler = MouseClickHandler(callback=self._cancel_pressed) + cancel_button.bind("", cancel_click_handler.enter) + cancel_button.bind("", cancel_click_handler.leave) + cancel_button.bind("", cancel_click_handler.release) + + ok_button = tk.Button(buttons_frame, takefocus=1, text="OK") + ok_button.pack(expand=1, side=tk.LEFT, padx='3m', pady='3m', ipadx='2m', ipady='1m') + ok_button.bind("", self._ok_pressed) + ok_click_handler = MouseClickHandler(callback=self._ok_pressed) + ok_button.bind("", ok_click_handler.enter) + ok_button.bind("", ok_click_handler.leave) + ok_button.bind("", ok_click_handler.release) + + self.entry_widgets[0].focus_force() # put the focus on the entry_widget + + def run(self): + self.boxRoot.mainloop() # run it! + self.boxRoot.destroy() # Close the window + return self.values + + def _cancel_pressed(self, *args): + self.values = None + self.boxRoot.quit() + + def _ok_pressed(self, _): + self.values = self._get_values() + if self.user_defined_callback: + self.user_defined_callback(self) + self.boxRoot.quit() + + def _get_values(self): + return [widget.get() for widget in self.entry_widgets] + + @staticmethod + def _process_fields_and_values(fields, values): + fields = [] if fields is None else list(fields) + values = [] if values is None else list(values) + padding_required = len(fields) - len(values) + if padding_required > 0: + values.extend([""] * padding_required) + return fields, values diff --git a/easygui/text_box.py b/easygui/text_box.py new file mode 100644 index 0000000..1e75423 --- /dev/null +++ b/easygui/text_box.py @@ -0,0 +1,238 @@ +import sys +import traceback + +import tkinter as tk +from tkinter import font + +from easygui.global_state import GLOBAL_WINDOW_POSITION +from easygui.utilities import get_num_lines, get_width_and_padding, MouseClickHandler + + +def textbox(msg='', title='', text='', codebox=False, callback=None, run=True): + """ + Displays a dialog box with a large, multi-line text box, and returns + the entered text as a string. The message text is displayed in a + proportional font and wraps. + + Parameters + ---------- + msg : string + text displayed in the message area (instructions...) + title : str + the window title + text: str, list or tuple + text displayed in textAreas (editable) + codebox: bool + if True, don't wrap and width is set to 80 chars + callback: function + if set, this function will be called when OK is pressed + run: bool + if True, a box object will be created and returned, but not run + + Returns + ------- + None + If cancel is pressed + str + If OK is pressed returns the contents of textArea. + TextBox + If the 'run' argument was False + """ + tb = TextBox(msg=msg, title=title, text=text, codebox=codebox, callback=callback) + if run: + text = tb.run() + return text + return tb + + +def codebox(msg='', title='', text=''): + """ + Helper method similar to textbox, displays text in a monospaced font which is useful for code. + + The text parameter should be a string, or a list or tuple of lines to be displayed in the textbox. + + :param str msg: the msg to be displayed + :param str title: the window title + :param str text: what to display in the textbox + """ + return textbox(msg, title, text, codebox=True) + + +def exceptionbox(msg='An error (exception) has occurred in the program.', title='Error Report'): + """ Display a box that gives information about the latest exception that has been raised. + + Display a box that gives information about the latest exception that has been raised. + + The caller may optionally pass in a title for the window, or a msg to accompany the error information. + + :param str msg: the msg to be displayed + :param str title: the window title + :return: None""" + + def format_exception_for_display(): + return "".join(traceback.format_exception(sys.exc_info()[0], sys.exc_info()[1], sys.exc_info()[2])) + + codebox(msg, title, format_exception_for_display()) + + +class TextBox(object): + """ Display a message, and an editable text field pre-populated with 'text' """ + + def __init__(self, msg, title, text, codebox, callback): + """ + :param msg: str displayed in the message area (instructions...) + :param title: str used as the window title + :param text: str displayed in textArea (editable) + :param codebox: bool (if true) don't wrap, set width to 80 chars, use monospace font + :param callback: optional function to be called when OK is pressed + """ + self._user_specified_callback = callback + self._text = text + self.msg = msg + + self.box_root = self._configure_box_root(title) + self.message_area = self._configure_message_area(box_root=self.box_root, code_box=codebox) + self._set_msg_area("" if msg is None else msg) + + self.MONOSPACE_FONT = font.Font(family='Courier') + self.text_area = self._configure_text_area(box_root=self.box_root, code_box=codebox) + self._set_text() + self._configure_buttons() + + + def _configure_box_root(self, title): + box_root = tk.Tk() + box_root.title(title) + box_root.iconname('Dialog') + box_root.geometry(GLOBAL_WINDOW_POSITION) + box_root.protocol('WM_DELETE_WINDOW', self.x_pressed) # Quit when x button pressed + box_root.bind("", self.cancel_button_pressed) + return box_root + + @staticmethod + def _configure_message_area(box_root, code_box): + padding, width_in_chars = get_width_and_padding(code_box) + + message_frame = tk.Frame(box_root, padx=padding) + message_frame.pack(side=tk.TOP, expand=1, fill='both') + + message_area = tk.Text(master=message_frame, + width=width_in_chars, + padx=padding, + pady=padding, + wrap=tk.WORD) + message_area.pack(side=tk.TOP, expand=1, fill='both') + return message_area + + def _configure_text_area(self, box_root, code_box): + padding, width_in_chars = get_width_and_padding(code_box) + + text_frame = tk.Frame(box_root, padx=padding, ) + text_frame.pack(side=tk.TOP) + + text_area = tk.Text(text_frame, padx=padding, pady=padding, height=25, width=width_in_chars) + text_area.configure(wrap=tk.NONE if code_box else tk.WORD) + + vertical_scrollbar = tk.Scrollbar(text_frame, orient=tk.VERTICAL, command=text_area.yview) + text_area.configure(yscrollcommand=vertical_scrollbar.set) + + horizontal_scrollbar = tk.Scrollbar(text_frame, orient=tk.HORIZONTAL, command=text_area.xview) + text_area.configure(xscrollcommand=horizontal_scrollbar.set) + + if code_box: + text_area.configure(font=self.MONOSPACE_FONT) + # no word-wrapping for code so we need a horizontal scroll bar + horizontal_scrollbar.pack(side=tk.BOTTOM, fill=tk.X) + + vertical_scrollbar.pack(side=tk.RIGHT, fill=tk.Y) + + # pack textArea last so bottom scrollbar displays properly + text_area.pack(side=tk.LEFT, fill=tk.BOTH, expand=tk.YES) + + box_root.bind("", text_area.yview_scroll(1, tk.PAGES)) + box_root.bind("", text_area.yview_scroll(-1, tk.PAGES)) + + box_root.bind("", text_area.xview_scroll(1, tk.PAGES)) + box_root.bind("", text_area.xview_scroll(-1, tk.PAGES)) + + box_root.bind("", text_area.yview_scroll(1, tk.UNITS)) + box_root.bind("", text_area.yview_scroll(-1, tk.UNITS)) + + return text_area + + def _set_msg_area(self, msg): + self.message_area.delete(1.0, tk.END) + self.message_area.insert(tk.END, msg) + num_lines = get_num_lines(message_area=self.message_area) + self.message_area.configure(height=int(num_lines)) + self.message_area.update() + + def run(self): + self.box_root.mainloop() + self.box_root.destroy() + return self.text + + def stop(self): + self.box_root.quit() + + def _configure_buttons(self): + buttons_frame = tk.Frame(self.box_root) + buttons_frame.pack(side=tk.TOP) + + cancel_button = tk.Button(buttons_frame, takefocus=tk.YES, text="Cancel", height=1, width=6) + cancel_button.pack(expand=tk.NO, side=tk.LEFT, padx='2m', pady='1m', ipady="1m", ipadx="2m") + cancel_button.bind("", self.cancel_button_pressed) + cancel_click_handler = MouseClickHandler(callback=self.cancel_button_pressed) + cancel_button.bind("", cancel_click_handler.enter) + cancel_button.bind("", cancel_click_handler.leave) + cancel_button.bind("", cancel_click_handler.release) + + ok_button = tk.Button(buttons_frame, takefocus=tk.YES, text="OK", height=1, width=6) + ok_button.pack(expand=tk.NO, side=tk.LEFT, padx='2m', pady='1m', ipady="1m", ipadx="2m") + ok_button.bind("", self.ok_button_pressed) + ok_click_handler = MouseClickHandler(callback=self.ok_button_pressed) + ok_button.bind("", ok_click_handler.enter) + ok_button.bind("", ok_click_handler.leave) + ok_button.bind("", ok_click_handler.release) + + @property + def text(self): + """ Get _text which may be None if cancel was pressed""" + return self._text + + @text.setter + def text(self, text): + self._text = text + if text is not None: # cancel sets text=None but this is meaningless to the tk box content + self._set_text() + + def _get_text(self): + """ Used by the callback to get the text_area content""" + return self.text_area.get(1.0, 'end-1c') + + def _set_text(self): + self.text_area.delete(1.0, tk.END) + self.text_area.insert(tk.END, self._text, "normal") + self.text_area.focus() + + # Methods executing when a key is pressed + def x_pressed(self, _): + self.callback(command='x') + + def cancel_button_pressed(self, _): + self.callback(command='cancel') + + def ok_button_pressed(self, _): + self.callback(command='update') + + def callback(self, command): + if command == 'update': # OK was pressed + self.text = self._get_text() + if self._user_specified_callback: + # If a callback was set, call main process + self._user_specified_callback(self) + else: + self.stop() + elif command in ('x', 'cancel'): + self.stop() + self.text = None diff --git a/easygui/utilities.py b/easygui/utilities.py new file mode 100644 index 0000000..8d4d4c5 --- /dev/null +++ b/easygui/utilities.py @@ -0,0 +1,154 @@ +import os +import re +import tkinter as tk + +from easygui.global_state import PROP_FONT_LINE_LENGTH, FIXW_FONT_LINE_LENGTH, DEFAULT_PADDING, REGULAR_FONT_WIDTH, \ + FIXED_FONT_WIDTH, boxRoot + + +def parse_hotkey(text): + """ + Extract a desired hotkey from the text. The format to enclose + the hotkey in square braces + as in Button_[1] which would assign the keyboard key 1 to that button. + The one will be included in the + button text. To hide they key, use double square braces as in: Ex[[qq]] + it , which would assign + the q key to the Exit button. Special keys such as may also be + used: Move [] for a full + list of special keys, see this reference: http://infohoglobal_state.nmt.edu/tcc/help/ + pubs/tkinter/web/key-names.html + :param text: + :return: list containing cleaned text, hotkey, and hotkey position within + cleaned text. + """ + + ret_val = [text, None, None] # Default return values + if text is None: + return ret_val + + # Single character, remain visible + res = re.search(r'(?<=\[).(?=\])', text) + if res: + start = res.start(0) + end = res.end(0) + caption = text[:start - 1] + text[start:end] + text[end + 1:] + ret_val = [caption, text[start:end], start - 1] + + # Single character, hide it + res = re.search(r'(?<=\[\[).(?=\]\])', text) + if res: + start = res.start(0) + end = res.end(0) + caption = text[:start - 2] + text[end + 2:] + ret_val = [caption, text[start:end], None] + + # a Keysym. Always hide it + res = re.search(r'(?<=\[\<).+(?=\>\])', text) + if res: + start = res.start(0) + end = res.end(0) + caption = text[:start - 2] + text[end + 2:] + ret_val = [caption, '<{}>'.format(text[start:end]), None] + + return ret_val + + +def load_tk_image(filename, tk_master=None): + """ + Load in an image file and return as a tk Image. + + Loads an image. If the PIL library is available use it. otherwise use the tk method. + + NOTE: tk_master is required if there are more than one Tk() instances, which there are very often. + REF: http://stackoverflow.com/a/23229091/2184122 + + :param filename: image filename to load + :param tk_master: root object (Tk()) + :return: tk Image object + """ + + if filename is None: + return None + + if not os.path.isfile(filename): + raise ValueError( + 'Image file {} does not exist.'.format(filename)) + + tk_image = None + + filename = os.path.normpath(filename) + _, ext = os.path.splitext(filename) + + try: + # Try to import the Python Image Library. If it doesn't exist, only .gif + from PIL import Image as PILImage + from PIL import ImageTk as PILImageTk + pil_image = PILImage.open(filename) + tk_image = PILImageTk.PhotoImage(pil_image, master=tk_master) + except ModuleNotFoundError: + try: + # Fallback if PIL isn't available + tk_image = tk.PhotoImage(file=filename, master=tk_master) + except: + msg = "Cannot load {}. Check to make sure it is an image file.".format( + filename) + try: + _ = PILImage + except: + msg += "\nPIL library isn't installed. If it isn't installed, only .gif files can be used." + raise ValueError(msg) + return tk_image + + +def get_num_lines(message_area): + num_lines, _ = message_area.index(tk.END).split('.') + return num_lines + + +def get_width_and_padding(monospace): + if monospace: + padding = DEFAULT_PADDING * FIXED_FONT_WIDTH + width_in_chars = FIXW_FONT_LINE_LENGTH + else: + padding = DEFAULT_PADDING * REGULAR_FONT_WIDTH + width_in_chars = PROP_FONT_LINE_LENGTH + return padding, width_in_chars + + +def bindArrows(widget): + widget.bind("", tabRight) + widget.bind("", tabLeft) + + widget.bind("", tabRight) + widget.bind("", tabLeft) + + +def tabRight(event): + boxRoot.event_generate("") + + +def tabLeft(event): + boxRoot.event_generate("") + + +class MouseClickHandler: + """ Handle mouse events with state to store whether the mouse is actually on a button or not. + This lets us ensure that: + * button presses are handled on mouse-release, *not* immediately on mouse-click + * callbacks are only called if there is a mouse-button release *and* your cursor is still on the button + """ + + def __init__(self, callback): + self._callback = callback + self._mouse_is_on_button = False + + def enter(self, _): + self._mouse_is_on_button = True + + def leave(self, _): + self._mouse_is_on_button = False + + def release(self, event): + if self._mouse_is_on_button: + return self._callback(event) \ No newline at end of file diff --git a/meta.yaml b/meta.yaml index a66d89a..ea3dc06 100644 --- a/meta.yaml +++ b/meta.yaml @@ -2,6 +2,9 @@ package: name: easygui version: "0.98.3.0" +build: + script: python setup.py install + source: path: . diff --git a/test/__init__.py b/requirements.txt similarity index 100% rename from test/__init__.py rename to requirements.txt diff --git a/test-requirements.txt b/requirements_for_tests.txt similarity index 100% rename from test-requirements.txt rename to requirements_for_tests.txt diff --git a/setup.py b/setup.py index 8179e06..44bf726 100644 --- a/setup.py +++ b/setup.py @@ -1,16 +1,13 @@ import distutils.core ## WARNING: Although the following import appears to do nothing, it is required for bdist_wheel to be recognized -from setuptools import setup, find_packages - -version = "0.98.3" -release = "0.98.3" +from easygui import version desc = list() desc.append('EasyGUI is a module for very simple, very easy GUI programming in Python. ') desc.append('EasyGUI is different from other GUI generators in that EasyGUI is NOT event-driven. ') desc.append('Instead, all GUI interactions are invoked by simple function calls.') -with open('README.md', "r", encoding='utf-8') as f: +with open('README.rst', "r", encoding='utf-8') as f: long_description = f.read() distutils.core.setup( @@ -33,17 +30,14 @@ 'Intended Audience :: Education', 'License :: OSI Approved :: BSD License', 'Programming Language :: Python', - 'Programming Language :: Python :: 2', - 'Programming Language :: Python :: 2.6', - 'Programming Language :: Python :: 2.7', - 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.3', - 'Programming Language :: Python :: 3.4', - 'Programming Language :: Python :: 3.5', 'Programming Language :: Python :: 3.6', 'Programming Language :: Python :: 3.7', 'Programming Language :: Python :: 3.8', 'Programming Language :: Python :: 3.9', + 'Programming Language :: Python :: 3.10', + 'Programming Language :: Python :: 3.11', + 'Programming Language :: Python :: 3.12', + 'Programming Language :: Python :: 3.13', 'Topic :: Software Development :: User Interfaces', ] ) diff --git a/sphinx/conf.py b/sphinx/conf.py index 6ac6e62..2e5a0de 100644 --- a/sphinx/conf.py +++ b/sphinx/conf.py @@ -280,8 +280,8 @@ def suppress_module_docstring(app, what, name, obj, options, lines): def functions_to_headers(app, what, name, obj, options, lines): if what == 'function': - lines.insert(0,'.. py:function:: freddy') # Not needed - lines.insert(1,'') + lines.insert_at(0, '.. py:function:: freddy') # Not needed + lines.insert_at(1, '') print(lines[0]) print(obj) print(options) diff --git a/sphinx/index.rst b/sphinx/index.rst index 8066196..641f9be 100644 --- a/sphinx/index.rst +++ b/sphinx/index.rst @@ -14,7 +14,3361 @@ EasyGUI runs on Python 2 and 3, and does not have any dependencies outside the P Example Usage ------------- - >>> import easygui +import easygui.button_box >>> import easygui + >>> easygui.button_box.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.button_box.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.button_box.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' +import easygui.button_box >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.button_box.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.button_box.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' +import easygui.button_box >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.button_box.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.button_box.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' +import easygui.button_box >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.button_box.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.button_box.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' +import easygui.button_box >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.button_box.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.button_box.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' +import easygui.button_box >>> easygui.button_box.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.button_box.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.button_box.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' +import easygui.button_box >>> easygui.button_box.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.button_box.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.button_box.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' +import easygui.button_box >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.button_box.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.button_box.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' +import easygui.button_box >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.button_box.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.button_box.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' +import easygui.button_box >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.button_box.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.button_box.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' +import easygui.button_box >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.button_box.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.button_box.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' +import easygui.button_box >>> easygui.button_box.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.button_box.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.button_box.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' +import easygui.button_box >>> easygui.button_box.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.button_box.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.button_box.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' +import easygui.button_box >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.button_box.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.button_box.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' +import easygui.button_box >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.button_box.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.button_box.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' +import easygui.button_box >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.button_box.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.button_box.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' +import easygui.button_box >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.button_box.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.button_box.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' +import easygui.button_box >>> easygui.button_box.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.button_box.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.button_box.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' +import easygui.button_box >>> easygui.button_box.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.button_box.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.button_box.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' +import easygui.button_box >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.button_box.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.button_box.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' +import easygui.button_box >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.button_box.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.button_box.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' +import easygui.button_box >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.button_box.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.button_box.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' +import easygui.button_box >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.button_box.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.button_box.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' +import easygui.button_box >>> easygui.button_box.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.button_box.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.button_box.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' +import easygui.button_box >>> easygui.button_box.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.button_box.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.button_box.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.button_box.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' +import easygui.button_box >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.button_box.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.button_box.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' +import easygui.button_box >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.button_box.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.button_box.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' +import easygui.button_box >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.button_box.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.button_box.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' +import easygui.button_box >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.button_box.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.button_box.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' +import easygui.button_box >>> easygui.button_box.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.button_box.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.button_box.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' +import easygui.button_box >>> easygui.button_box.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.button_box.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.button_box.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.button_box.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' +import easygui.button_box >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.button_box.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.button_box.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' +import easygui.button_box >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.button_box.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.button_box.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' +import easygui.button_box >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.button_box.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.button_box.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' +import easygui.button_box >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.button_box.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.button_box.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' +import easygui.button_box >>> easygui.button_box.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.button_box.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.button_box.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' +import easygui.button_box >>> easygui.button_box.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True +import easygui.button_box >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.button_box.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.button_box.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True +import easygui.button_box >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.button_box.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.button_box.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True +import easygui.button_box >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.button_box.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.button_box.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True +import easygui.button_box >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.button_box.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.button_box.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True +import easygui.button_box >>> easygui.button_box.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.button_box.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.button_box.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True +import easygui.button_box >>> easygui.button_box.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.button_box.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.button_box.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True +import easygui.button_box >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.button_box.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.button_box.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True +import easygui.button_box >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.button_box.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.button_box.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True +import easygui.button_box >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.button_box.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.button_box.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True +import easygui.button_box >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.button_box.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.button_box.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True +import easygui.button_box >>> easygui.button_box.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.button_box.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.button_box.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True +import easygui.button_box >>> easygui.button_box.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.button_box.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.button_box.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True +import easygui.button_box >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.button_box.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.button_box.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True +import easygui.button_box >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.button_box.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.button_box.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True +import easygui.button_box >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.button_box.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.button_box.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True +import easygui.button_box >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.button_box.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.button_box.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True +import easygui.button_box >>> easygui.button_box.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.button_box.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.button_box.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True +import easygui.button_box >>> easygui.button_box.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.button_box.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.button_box.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True +import easygui.button_box >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.button_box.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.button_box.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True +import easygui.button_box >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.button_box.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.button_box.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True +import easygui.button_box >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.button_box.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.button_box.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True +import easygui.button_box >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.button_box.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.button_box.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True +import easygui.button_box >>> easygui.button_box.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.button_box.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.button_box.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True +import easygui.button_box >>> easygui.button_box.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.button_box.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.button_box.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True +import easygui.button_box >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.button_box.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.button_box.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True +import easygui.button_box >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.button_box.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.button_box.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True +import easygui.button_box >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.button_box.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.button_box.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True +import easygui.button_box >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.button_box.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.button_box.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True +import easygui.button_box >>> easygui.button_box.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.button_box.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.button_box.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True +import easygui.button_box >>> easygui.button_box.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.button_box.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.button_box.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.button_box.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True +import easygui.button_box >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.button_box.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.button_box.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True +import easygui.button_box >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.button_box.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.button_box.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True +import easygui.button_box >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.button_box.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.button_box.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True +import easygui.button_box >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.button_box.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.button_box.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True +import easygui.button_box >>> easygui.button_box.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.button_box.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.button_box.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True +import easygui.button_box >>> easygui.button_box.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.button_box.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.button_box.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.button_box.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True +import easygui.button_box >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.button_box.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.button_box.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True +import easygui.button_box >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.button_box.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.button_box.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True +import easygui.button_box >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.button_box.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.button_box.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True +import easygui.button_box >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.button_box.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.button_box.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True +import easygui.button_box >>> easygui.button_box.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.button_box.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.button_box.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True +import easygui.button_box >>> easygui.button_box.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.button_box.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' + >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes + True + >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK + 'OK' + import easygui.button_box >>> easygui.button_box.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) # click Chocolate + 'Chocolate' >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) # click Yes True >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') # click OK diff --git a/test/test_travis.py b/test/test_travis.py deleted file mode 100644 index 5a1aa34..0000000 --- a/test/test_travis.py +++ /dev/null @@ -1,6 +0,0 @@ -def test_always_passes(): - assert True - -# @staticmethod -# def test_always_fails(): -# assert False diff --git a/test_cases/__init__.py b/test_cases/__init__.py deleted file mode 100644 index e69de29..0000000 diff --git a/test_cases/file_open_box.py b/test_cases/file_open_box.py deleted file mode 100644 index 98282e2..0000000 --- a/test_cases/file_open_box.py +++ /dev/null @@ -1,11 +0,0 @@ -__author__ = 'Robert' -""" -from: -http://stackoverflow.com/questions/25087169/python-easygui-cant-select-file - -""" -import sys -sys.path.append('..') -import easygui -f = easygui.fileopenbox() -print(f) \ No newline at end of file diff --git a/tests/__init__.py b/tests/__init__.py new file mode 100644 index 0000000..bc38561 --- /dev/null +++ b/tests/__init__.py @@ -0,0 +1,2 @@ +WAIT_0_MILLISECONDS = 0 +WAIT_1_MILLISECONDS = 1 \ No newline at end of file diff --git a/tests/test_choice_box.py b/tests/test_choice_box.py new file mode 100644 index 0000000..1cfe805 --- /dev/null +++ b/tests/test_choice_box.py @@ -0,0 +1,57 @@ +import unittest + +from unittest.mock import patch, Mock + +from easygui.choice_box import choicebox, multchoicebox + +MODBASE = 'easygui.choice_box' + +TEST_MESSAGE = 'example message' +TEST_TITLE = 'example title' +TEST_CHOICES = ['choice 1', 'choice 2'] +TEST_PRESELECT = [] +TEST_CALLBACK = Mock() + +TEST_RETURN_TEXT = 'return text' + + +@patch(MODBASE + '.ChoiceBox') +class TestChoiceBoxUtilities(unittest.TestCase): + def configureMocks(self, mock_choicebox_class): + self.mock_choicebox_instance = Mock() + self.mock_choicebox_instance.run = Mock(return_value=TEST_RETURN_TEXT) + mock_choicebox_class.return_value = self.mock_choicebox_instance + + def test_choicebox_method_instantiates_choicebox_class_correctly_and_runs_it(self, mock_choicebox_class): + self.configureMocks(mock_choicebox_class) + + return_text = choicebox(msg=TEST_MESSAGE, title=TEST_TITLE, choices=TEST_CHOICES, preselect=TEST_PRESELECT, + callback=TEST_CALLBACK, run=True) + + self.assertEqual(return_text, TEST_RETURN_TEXT) + mock_choicebox_class.assert_called_once_with( + TEST_MESSAGE, + TEST_TITLE, + TEST_CHOICES, + preselect=TEST_PRESELECT, + multiple_select=False, # this is the only difference between choicebox() and multchoicebox() + callback=TEST_CALLBACK + ) + self.mock_choicebox_instance.run.assert_called_once_with() + + def test_multchoicebox_method_instantiates_choicebox_class_correctly_and_runs_it(self, mock_choicebox_class): + self.configureMocks(mock_choicebox_class) + + return_text = multchoicebox(msg=TEST_MESSAGE, title=TEST_TITLE, choices=TEST_CHOICES, preselect=TEST_PRESELECT, + callback=TEST_CALLBACK, run=True) + + self.assertEqual(return_text, TEST_RETURN_TEXT) + mock_choicebox_class.assert_called_once_with( + TEST_MESSAGE, + TEST_TITLE, + TEST_CHOICES, + preselect=TEST_PRESELECT, + multiple_select=True, # this is the only difference between choicebox() and multchoicebox() + callback=TEST_CALLBACK + ) + self.mock_choicebox_instance.run.assert_called_once_with() diff --git a/test_cases/test_easygui.py b/tests/test_easygui.py similarity index 67% rename from test_cases/test_easygui.py rename to tests/test_easygui.py index d5ce42f..3eb04e2 100644 --- a/test_cases/test_easygui.py +++ b/tests/test_easygui.py @@ -1,5 +1,3 @@ -import easygui - import inspect import os import time @@ -7,6 +5,8 @@ from pynput.keyboard import Key, Controller +import easygui.button_box + KEYBOARD = Controller() FOLDER_OF_THIS_FILE = os.path.dirname(os.path.abspath(__file__)) GUI_WAIT = 0.6 # if tests start failing, maybe try bumping this up a bit (though that'll slow the tests down) @@ -38,8 +38,8 @@ def run(self): def test_test_images_exist(): - assert os.path.exists(os.path.join(FOLDER_OF_THIS_FILE, 'pi.jpg')) - assert os.path.exists(os.path.join(FOLDER_OF_THIS_FILE, 'result.png')) + assert os.path.exists(os.path.join(FOLDER_OF_THIS_FILE, '../demos/pi.jpg')) + assert os.path.exists(os.path.join(FOLDER_OF_THIS_FILE, '../demos/result.png')) def test_spacebar_clicks_choice(): """ @@ -52,31 +52,33 @@ def test_spacebar_clicks_choice(): (('Message', 'Title'), {}, 'OK'), # custom message and title ((), dict(ok_button='Button'), 'Button'), # custom button text (('Message', 'Title'), dict(ok_button='Button'), 'Button'), # combo of all three - ((), dict(image=os.path.join(FOLDER_OF_THIS_FILE, 'pi.jpg')), 'OK'), # test jpg - ((), dict(image=os.path.join(FOLDER_OF_THIS_FILE, 'result.png')), 'OK'), # test png + ((), dict(image=os.path.join(FOLDER_OF_THIS_FILE, '../demos/images/python_and_check_logo.gif')), 'OK'), # gif + ((), dict(image=os.path.join(FOLDER_OF_THIS_FILE, '../demos/images/python_and_check_logo.png')), 'OK'), # png + # ((), dict(image=os.path.join(FOLDER_OF_THIS_FILE, '../demos/images/python_and_check_logo.jpg')), 'OK'), # jpg ... requires PIL library ) for args, kwargs, expected in parameters: k = KeyPresses(' ') k.start() - assert easygui.msgbox(*args, **kwargs) == expected + actual = easygui.button_box.msgbox(*args, **kwargs) + assert actual == expected def test_buttonbox(): # Test hitting space to click OK with different default buttons: t = KeyPresses(' ') t.start() print('Line', inspect.currentframe().f_lineno) - assert easygui.buttonbox('Message', 'Title', choices=('Button[1]', 'Button[2]', 'Button[3]'), default_choice='Button[1]') == 'Button[1]' + assert easygui.button_box.buttonbox('Message', 'Title', choices=('Button[1]', 'Button[2]', 'Button[3]'), default_choice='Button[1]') == 'Button[1]' t = KeyPresses(' ') t.start() print('Line', inspect.currentframe().f_lineno) - assert easygui.buttonbox('Message', 'Title', choices=('Button[1]', 'Button[2]', 'Button[3]'), default_choice='Button[2]') == 'Button[2]' + assert easygui.button_box.buttonbox('Message', 'Title', choices=('Button[1]', 'Button[2]', 'Button[3]'), default_choice='Button[2]') == 'Button[2]' t = KeyPresses(' ') t.start() print('Line', inspect.currentframe().f_lineno) - assert easygui.buttonbox('Message', 'Title', choices=('Button[1]', 'Button[2]', 'Button[3]'), default_choice='Button[3]') == 'Button[3]' + assert easygui.button_box.buttonbox('Message', 'Title', choices=('Button[1]', 'Button[2]', 'Button[3]'), default_choice='Button[3]') == 'Button[3]' # Test hitting Esc to close. # TODO: If button boxes aren't given a default choice, then their window won't be in focus and this test hangs. @@ -89,4 +91,4 @@ def test_buttonbox(): t = KeyPresses([Key.esc]) t.start() print('Line', inspect.currentframe().f_lineno) - assert easygui.buttonbox(default_choice='Button[1]') is None + assert easygui.button_box.buttonbox(default_choice='Button[1]') is None diff --git a/tests/test_multi_fillable_box.py b/tests/test_multi_fillable_box.py new file mode 100644 index 0000000..9ca660d --- /dev/null +++ b/tests/test_multi_fillable_box.py @@ -0,0 +1,15 @@ +from easygui import multenterbox +from tests import WAIT_0_MILLISECONDS + + +def test__multenterbox__cancel_results_in_run_returning_none(): + meb = multenterbox(msg="test msg", title="test title", + fields=['f1', 'f2'], values=['v1', 'v2'], + callback=None, run=False) + + def simulate_user_cancel_press(meb_instance): + meb_instance._cancel_pressed('ignored button handler arg') + + meb.boxRoot.after(WAIT_0_MILLISECONDS, simulate_user_cancel_press, meb) + actual = meb.run() + assert actual is None diff --git a/tests/test_text_box.py b/tests/test_text_box.py new file mode 100644 index 0000000..47dce82 --- /dev/null +++ b/tests/test_text_box.py @@ -0,0 +1,130 @@ +import tkinter as tk +import unittest +from unittest.mock import patch, Mock, ANY + +import pytest + +from easygui.text_box import TextBox, textbox, codebox +from tests import WAIT_0_MILLISECONDS, WAIT_1_MILLISECONDS + +MODBASE = 'easygui.text_box' + +TEST_MESSAGE = 'example message' +TEST_TITLE = 'example title' +TEST_TEXT = 'example text' +TEST_MONOSPACE = False +TEST_CALLBACK = Mock() +TEST_ARGS = [TEST_MESSAGE, TEST_TITLE, TEST_TEXT, TEST_MONOSPACE, TEST_CALLBACK] + + +def test__textbox_method__instantiates_textbox_class_and_runs_it(): + """ Test that the textbox() method calls the underlying TextBox class in the expected way """ + with patch(MODBASE + '.TextBox') as mock_text_box_class: + mock_text_box_instance = Mock() + mock_text_box_instance.run = Mock(return_value='return text') + mock_text_box_class.return_value = mock_text_box_instance + + return_text = textbox(TEST_MESSAGE, TEST_TITLE, TEST_TEXT, TEST_CALLBACK, run=True) + + mock_text_box_class.assert_called_once_with( + msg=TEST_MESSAGE, + title=TEST_TITLE, + text=TEST_TEXT, + monospace=TEST_MONOSPACE, + callback=TEST_CALLBACK + ) + mock_text_box_instance.run.assert_called_once_with() + assert return_text == 'return text' + + +@pytest.fixture() +def test_textbox(): + yield TextBox(*TEST_ARGS) + + +def test_instantiation(test_textbox): + # Instance attributes should be configured: + assert test_textbox.text == TEST_TEXT + assert test_textbox.msg.strip() == TEST_MESSAGE + assert test_textbox._user_specified_callback == TEST_CALLBACK + + # The following Tk widgets should also have been created: + assert isinstance(test_textbox.box_root, tk.Tk) + assert isinstance(test_textbox.msg_widget, tk.Text) + assert isinstance(test_textbox.text_area, tk.Text) + + # And configured: + assert test_textbox.msg_widget.get(0.0, 'end-1c') == TEST_MESSAGE + assert test_textbox.text_area.get(0.0, 'end-1c') == TEST_TEXT + + +def test_run(test_textbox): + with unittest.mock.patch.object(test_textbox, 'box_root') as mockroot: + assert test_textbox.run() is None + mockroot.mainloop.assert_called_once_with() + mockroot.destroy.assert_called_once_with() + + +def test_stop(test_textbox): + with unittest.mock.patch.object(test_textbox, 'box_root') as mockroot: + test_textbox.stop() + mockroot.quit.assert_called_once_with() + + +def test_set_msg_area(test_textbox): + new_msg = 'some new text' + test_textbox.msg = new_msg + assert test_textbox.msg_widget.get(1.0, 'end-1c') == new_msg + + +def test_set_text(test_textbox): + assert test_textbox.text == TEST_TEXT + + new_text = 'some new text' + test_textbox.text = new_text + assert test_textbox.text_area.get(1.0, 'end-1c') == new_text + + +def test_textbox_cancel_button_pressed_results_in_run_returning_None(): + tb = textbox(run=False) + + def simulate_cancel_button_pressed(tb_instance): + tb_instance.cancel_button_pressed('ignored button handler arg') + + tb.box_root.after(WAIT_0_MILLISECONDS, simulate_cancel_button_pressed, tb) + assert tb.run() is None + + +def test_textbox_ok_pressed_calls_user_defined_callback(): + user_defined_callback = Mock() + tb = textbox(text=TEST_TEXT, callback=user_defined_callback, run=False) + + def simulate_ok_button_pressed(tb_instance): + tb_instance.ok_button_pressed('ignored button handler arg') + + def stop_running(tb_instance): + tb_instance.stop() + + tb.box_root.after(WAIT_0_MILLISECONDS, simulate_ok_button_pressed, tb) + tb.box_root.after(WAIT_1_MILLISECONDS, stop_running, tb) + assert tb.run() == TEST_TEXT + user_defined_callback.assert_called_once_with(ANY) + + +def test_textbox_ok_pressed_with_no_user_defined_callback(): + tb = textbox(msg=TEST_MESSAGE, title=TEST_TITLE, text=TEST_TEXT, run=False) + + def simulate_ok_button_pressed(tb_instance): + tb_instance.ok_button_pressed('ignored button handler arg') + + tb.box_root.after(WAIT_0_MILLISECONDS, simulate_ok_button_pressed, tb) + # tb.stop() happens because no user _user_specified_callback is set + # the initial text value is unchanged, and is returned from run() + assert tb.run() == TEST_TEXT + + +def test_instantiation_codebox(): + cb = codebox(msg=TEST_MESSAGE, title=TEST_TITLE, text=TEST_TEXT * 100, callback=TEST_CALLBACK, run=False) + + # cget returns strings so the monospace assertion is a bit messy: + assert cb.text_area.cget('font') == "font1" # a monospace font