ž
ÒÏ M@` c               @   s)  d  Z  e  j ƒ  d Z d d d d d d d d	 d
 d d d d d d d d d d d d d d g Z d d l Z d d l Z d d l Z d d l Z d d l Z e j	 d k rµ d£ Z n d¤ Z e j	 d k rÓ d£ Z n d¤ Z y* d d l m Z d d l m Z d£ Z Wn d¤ Z Yn Xe rFd d l Td d l j Z d d  l m Z n& d d l Td d l Z d d  l m Z d! d" „  Z d# d$ „  Z e Z e d% k  rØd& d' Z  e d( e  d) e! e ƒ d* e  d( ƒ e j" d ƒ n  d+ d, „  Z# d- a$ d¥ Z% d1 Z& d2 Z' d3 Z( d4 Z) d5 d6 d7 g Z* d a, d a- d a. d a/ d a0 d a1 d8 a2 d8 a3 d a4 d a5 d a6 d a7 d9 Z8 d: d; d¦ d d> d „ Z9 d: d; d§ d dA d „ Z: d: d; d¨ d dB d „ Z; d: d; d© d dC d „ Z< dD d; dE d d dF d „ Z= d8 d; dª d d dJ d „ Z> d8 d; d8 d dK d d dL d „ Z? dM d; f  f  dN d	 „ Z@ dM d; eA ƒ  eA ƒ  dO d „ ZB dP dQ „  ZC dR dS „  ZD dT dU „  ZE dM d; f  f  d dV dW „ ZF dX dY „  ZG dZ d[ „  ZH d\ d; d8 d£ d d d] d
 „ ZI d^ d; d8 d d d_ d „ ZJ d8 d8 d d d d` da „ ZK db dc „  ZL dd de „  ZM df dg „  ZN dh di „  ZO dj d; f  dk d „ ZP dl d; f  dm d „ ZQ dn do „  ZR dp dq „  ZS dr ds „  ZT dt du „  ZU dv dw „  ZV dx dy „  ZW dz d{ „  ZX d d d| d „ ZY d8 d; d8 d} d „ ZZ d8 d; d8 d d~ d „ Z[ d d€ „  Z\ d d d d d „ Z] d‚ dƒ „  Z^ Gd„ d… „  d… ƒ Z_ d d d& d d† d „ Z` d d d8 d d‡ d „ Za dˆ d‰ „  Zb dŠ d‹ „  Zc dŒ d „  Zd GdŽ d „  d ƒ Ze d d „  Zf d d‘ „  Zg d’ d“ „  Zh d” d• „  Zi d– d— „  Zj d˜ d™ „  Zk dš d› „  Zl dœ d „  Zm dž dŸ „  Zn d  Zo d¡ d „  Zp eq d¢ k r%ef ƒ  n  d S(«   u£  
@version: 0.96(2010-08-29)

@note:
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.

@note:
WARNING about 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 that EasyGui requires Tk release 8.0 or greater.

@note:
LICENSE INFORMATION

EasyGui version 0.96

Copyright (c) 2010, 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.

@note:
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 http://en.wikipedia.org/wiki/License_compatibility
See http://www.gnu.org/licenses/license-list.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.
http://en.wikipedia.org/wiki/BSD_licenses#3-clause_license_.28.22New_BSD_License.22.29

i   u   ynboxu   ccboxu   boolboxu   indexboxu   msgboxu	   buttonboxu
   integerboxu   multenterboxu   enterboxu   exceptionboxu	   choiceboxu   codeboxu   textboxu
   diropenboxu   fileopenboxu   filesaveboxu   passwordboxu   multpasswordboxu   multchoiceboxu   abouteasyguiu	   egversionu   egdemou   EgStorei    Nið ið  (   u   Image(   u   ImageTk(   u   *(   u   StringIOc              G   s6   d d „  |  Dƒ }  d j  |  ƒ }  t j j |  ƒ d  S(   Nc             S   s   g  |  ] } t  | ƒ ‘ q S(    (   u   str(   u   .0u   arg(    (    uO   /Users/mwc/Documents/School Work/KS3 Units/Y9/Python/Lesson 1 - Quiz/easygui.pyu
   <listcomp>›   s   	 u   write.<locals>.<listcomp>u    (   u   joinu   sysu   stdoutu   write(   u   args(    (    uO   /Users/mwc/Documents/School Work/KS3 Units/Y9/Python/Lesson 1 - Quiz/easygui.pyu   writeš   s    u   writec              G   s   t  |  Œ  t j j  d ƒ d  S(   Nu   
(   u   writeu   sysu   stdout(   u   args(    (    uO   /Users/mwc/Documents/School Work/KS3 Units/Y9/Python/Lesson 1 - Quiz/easygui.pyu   writelnŸ   s    
u   writelng       @u   *iK   u   


u   
You are running Tk version: uJ   
You must be using Tk version 8.0 or greater to use EasyGui.
Terminating.
c             C   s   d |  S(   Nu   "%s"(    (   u   s(    (    uO   /Users/mwc/Documents/School Work/KS3 Units/Y9/Python/Lesson 1 - Quiz/easygui.pyu   dq¯   s    u   dqu   +300+200u   MSu   Sansu   Serifu   Courieri
   i	   i   u   Returnu   Button-1u   spaceu    u<   

---------------------------------------------
Error: %s
%su   Shall I continue?u    u   Yesu   Noc             C   s   t  |  | | d | ƒS(   u~  
    Display a msgbox with choices of Yes and No.

    The default is "Yes".

    The returned value is calculated this way::
        if the first choice ("Yes") is chosen, or if the dialog is cancelled:
            return 1
        else:
            return 0

    If invoked without a msg argument, displays a generic request for a confirmation
    that the user wishes to continue.  So it can be used this way::
        if ynbox(): pass # continue
        else: sys.exit(0)  # exit the program

    @arg msg: the msg to be displayed.
    @arg title: the window title
    @arg choices: a list or tuple of the choices to be displayed
    u   image(   u   boolbox(   u   msgu   titleu   choicesu   image(    (    uO   /Users/mwc/Documents/School Work/KS3 Units/Y9/Python/Lesson 1 - Quiz/easygui.pyu   ynboxÕ   s    u   Continueu   Cancelc             C   s   t  |  | | d | ƒS(   uª  
    Display a msgbox with choices of Continue and Cancel.

    The default is "Continue".

    The returned value is calculated this way::
        if the first choice ("Continue") is chosen, or if the dialog is cancelled:
            return 1
        else:
            return 0

    If invoked without a msg argument, displays a generic request for a confirmation
    that the user wishes to continue.  So it can be used this way::

        if ccbox():
            pass # continue
        else:
            sys.exit(0)  # exit the program

    @arg msg: the msg to be displayed.
    @arg title: the window title
    @arg choices: a list or tuple of the choices to be displayed
    u   image(   u   boolbox(   u   msgu   titleu   choicesu   image(    (    uO   /Users/mwc/Documents/School Work/KS3 Units/Y9/Python/Lesson 1 - Quiz/easygui.pyu   ccboxô   s    c          	   C   s=   t  d |  d | d | d | ƒ } | | d k r5 d Sd Sd S(   uú   
    Display a boolean msgbox.

    The default is the first choice.

    The returned value is calculated this way::
        if the first choice is chosen, or if the dialog is cancelled:
            returns 1
        else:
            returns 0
    u   msgu   choicesu   titleu   imagei    i   N(   u	   buttonbox(   u   msgu   titleu   choicesu   imageu   reply(    (    uO   /Users/mwc/Documents/School Work/KS3 Units/Y9/Python/Lesson 1 - Quiz/easygui.pyu   boolbox  s    ! c          	   C   sb   t  d |  d | d | d | ƒ } d } x( | D]  } | d } | | k r. | Sq. Wt d ƒ ‚ d S(	   uf   
    Display a buttonbox with the specified choices.
    Return the index of the choice selected.
    u   msgu   choicesu   titleu   imagei   u@   There is a program logic error in the EasyGui code for indexbox.Niÿÿÿÿ(   u	   buttonboxu   AssertionError(   u   msgu   titleu   choicesu   imageu   replyu   indexu   choice(    (    uO   /Users/mwc/Documents/School Work/KS3 Units/Y9/Python/Lesson 1 - Quiz/easygui.pyu   indexbox.  s    	!
 u   (Your message goes here)u   OKc             C   sO   t  | ƒ t  d ƒ k r' t d ƒ ‚ n  t d |  d | d | g d | d | ƒ S(   u   
    Display a messagebox
    u   OKu4   The 'ok_button' argument to msgbox must be a string.u   msgu   titleu   choicesu   imageu   root(   u   typeu   AssertionErroru	   buttonbox(   u   msgu   titleu	   ok_buttonu   imageu   root(    (    uO   /Users/mwc/Documents/School Work/KS3 Units/Y9/Python/Lesson 1 - Quiz/easygui.pyu   msgboxC  s    u   Button1u   Button2u   Button3c             C   sé  | d a  | r6 | j ƒ  t d | ƒ a t j ƒ  n t ƒ  a t j ƒ  t j d t ƒ t j | ƒ t j d ƒ t j	 t
 ƒ t j d d ƒ t d t ƒ } | j d t d t ƒ d } | r´t j j | ƒ } t j j | ƒ \ } }	 t j j | ƒ r|	 j ƒ  d k r't d t d | ƒ } q±t r~y( t j | ƒ }
 t j |
 d t ƒ} Wqš|  t | d t ƒ  f 7}  YqšXq±|  t | d |	 d f 7}  q´|  t | d f 7}  n  | r%t d t ƒ } | j d t d t ƒ t | d | ƒ} | | _ | j d t d t  d t! d d d d ƒ n  t d t ƒ a" t" j d t d t ƒ t# | d |  d d ƒ} | j$ d t% t& f ƒ | j d t d t  d t! d d d d ƒ t' | ƒ t( j) ƒ  t j* ƒ  t j+ ƒ  t j, ƒ  | rå| j* ƒ  n  t  S(   u;  
    Display a msg, a title, and a set of buttons.
    The buttons are defined by the members of the choices list.
    Return the text of the button that the user selected.

    @arg msg: the msg to be displayed.
    @arg title: the window title
    @arg choices: a list or tuple of the choices to be displayed
    i    u   masteru   WM_DELETE_WINDOWu   Dialogi  id   u   sideu   fillu   .gifu   .pgmu   .ppmu   fileud   
The Python Imaging Library (PIL) could not convert this file to a displayable image.

PIL reports:
u   
I could not import the Python Imaging Library (PIL) to display the image.

You may need to install PIL
(http://www.pythonware.com/products/pil/)
to display u    image files.u   
Image file not found.u   imageu   expandu   padxu   1mu   padyu   textu   widthu   fontu   3mN(   u   .gifu   .pgmu   .ppm(-   u   __replyButtonTextu   withdrawu   Toplevelu   boxRootu   Tku   protocolu   denyWindowManagerCloseu   titleu   iconnameu   geometryu   rootWindowPositionu   minsizeu   Frameu   packu   TOPu   BOTHu   Noneu   osu   pathu   normpathu   splitextu   existsu   loweru
   PhotoImageu   PILisLoadedu   PILImageu   openu
   PILImageTku   ImageErrorMsgu   exception_formatu   Labelu   imageu   YESu   Xu   buttonsFrameu   Messageu	   configureu   PROPORTIONAL_FONT_FAMILYu   PROPORTIONAL_FONT_SIZEu   __put_buttons_in_buttonframeu   __firstWidgetu   focus_forceu	   deiconifyu   mainloopu   destroy(   u   msgu   titleu   choicesu   imageu   rootu   messageFrameu   tk_Imageu   imageFilenameu   junku   extu	   pil_Imageu
   imageFrameu   labelu   messageWidget(    (    uO   /Users/mwc/Documents/School Work/KS3 Units/Y9/Python/Lesson 1 - Quiz/easygui.pyu	   buttonboxP  sf    

	
			+(




 ic   c       	      K   s  d | k r t  d d ƒ ‚ n  d | k r> t  d d ƒ ‚ n  | d k r‹ t | ƒ t d ƒ k r‹ t  d	 d
 t t | ƒ ƒ d ƒ ‚ q‹ n  t | ƒ t d ƒ k rÉ t  d	 d t t | ƒ ƒ d ƒ ‚ n  t | ƒ t d ƒ k rt  d	 d t t | ƒ ƒ d ƒ ‚ n  |  d k r4d t | ƒ d t | ƒ }  n  xÍ t |  | t | ƒ d | d | ƒ} | d k rkd Sy t | ƒ } Wn( t d t t | ƒ ƒ d ƒ w7Yn X| | k  rÓt d t | ƒ d d ƒ q7n  | | k r t d t | ƒ d d ƒ q7n  | Sd S(   uê  
    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 argument 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.

    NOTE that the "argLowerBound" and "argUpperBound" arguments are no longer
    supported.  They have been replaced by "upperbound" and "lowerbound".
    u   argLowerBoundu=   
integerbox no longer supports the 'argLowerBound' argument.
u   Use 'lowerbound' instead.

u   argUpperBoundu=   
integerbox no longer supports the 'argUpperBound' argument.
u   Use 'upperbound' instead.

u    i   u,   integerbox received a non-integer value for u   default of u   Erroru   lowerbound of u   upperbound of u   Enter an integer between u    and u   imageu   rootu2   The value that you entered:
	%s
is not an integer.u;   The value that you entered is less than the lower bound of u   .u>   The value that you entered is greater than the upper bound of N(   u   AssertionErroru   typeu   dqu   stru   enterboxu   Noneu   intu   msgbox(	   u   msgu   titleu   defaultu
   lowerboundu
   upperboundu   imageu   rootu   invalidKeywordArgumentsu   reply(    (    uO   /Users/mwc/Documents/School Work/KS3 Units/Y9/Python/Lesson 1 - Quiz/easygui.pyu
   integerbox´  sN    &##!$ u   Fill in values for the fields.c             C   s   t  |  | | | d ƒ S(   u”  
    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 == 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)

        writeln("Reply was: %s" % str(fieldValues))
        ----------------------------------------------------------------------

    @arg msg: the msg to be displayed.
    @arg title: the window title
    @arg fields: a list of fieldnames.
    @arg values:  a list of field values
    N(   u   __multfillableboxu   None(   u   msgu   titleu   fieldsu   values(    (    uO   /Users/mwc/Documents/School Work/KS3 Units/Y9/Python/Lesson 1 - Quiz/easygui.pyu   multenterbox  s    -c             C   s   t  |  | | | d ƒ S(   uU  
    Same interface as multenterbox.  But in multpassword box,
    the last of the fields is assumed to be a password, and
    is masked with asterisks.

    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 == 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)

        writeln("Reply was: %s" % str(fieldValues))
    u   *(   u   __multfillablebox(   u   msgu   titleu   fieldsu   values(    (    uO   /Users/mwc/Documents/School Work/KS3 Units/Y9/Python/Lesson 1 - Quiz/easygui.pyu   multpasswordbox@  s    !c             C   sD   |  j  d t ƒ |  j  d t ƒ |  j  d t ƒ |  j  d t ƒ d  S(   Nu   <Down>u   <Up>u   <Right>u   <Left>(   u   bindu   tabRightu   tabLeft(   u   widget(    (    uO   /Users/mwc/Documents/School Work/KS3 Units/Y9/Python/Lesson 1 - Quiz/easygui.pyu
   bindArrowsc  s    u
   bindArrowsc             C   s   t  j d ƒ d  S(   Nu   <Tab>(   u   boxRootu   event_generate(   u   event(    (    uO   /Users/mwc/Documents/School Work/KS3 Units/Y9/Python/Lesson 1 - Quiz/easygui.pyu   tabRightj  s    u   tabRightc             C   s   t  j d ƒ d  S(   Nu   <Shift-Tab>(   u   boxRootu   event_generate(   u   event(    (    uO   /Users/mwc/Documents/School Work/KS3 Units/Y9/Python/Lesson 1 - Quiz/easygui.pyu   tabLeftm  s    u   tabLeftc             C   s1  d d g } t  | ƒ d k r" d  St | d  d  … ƒ } t | d  d  … ƒ } t  | ƒ t  | ƒ k ri n] t  | ƒ t  | ƒ k rš | d t  | ƒ … } n, x) t  | ƒ t  | ƒ k  rÅ | j d ƒ q Wt ƒ  a t j d t ƒ t j | ƒ t j	 d ƒ t j
 t ƒ t j d t ƒ t d t ƒ } | j d	 t d
 t ƒ t | d d d |  ƒ} | j d t t f ƒ | j d	 t d d d
 t d d d d ƒ g  a t  | ƒ d } x:t t  | ƒ ƒ D]&}	 | |	 }
 | |	 } t d t ƒ } | j d	 t d
 t ƒ t | d |
 ƒ} | j d	 t ƒ t | d d d d ƒa t j t ƒ t j d t t f ƒ t j d	 t d d ƒ t t ƒ t j d t ƒ t j d t ƒ |	 | k rÂ| rÂt |	 j d | ƒ qÂn  t |	 j  d | ƒ |	 d 7}	 qºWt d t ƒ } | j d	 t! d
 t ƒ t" | d d d d ƒa# t t# ƒ t# j d d d	 t d d d d d d d d ƒ t# } t } x" t$ D] } | j d | | ƒ qlWt" | d d d d ƒa% t t% ƒ t% j d d d	 t d d d d d d d d ƒ t% } t } x" t$ D] } | j d | | ƒ qíWt d j& ƒ  t j' ƒ  t j( ƒ  t) S(   Nu   OKu   Canceli    u    u   WM_DELETE_WINDOWu   Dialogu   <Escape>u   masteru   sideu   fillu   widthu   4.5iu   textu   fontu   expandi   u   padxu   3mu   padyi(   u   highlightthicknessi   u   <Return>u   showu	   takefocusu   ipadxu   2mu   ipadyu   1mu   <%s>(*   u   lenu   Noneu   listu   appendu   Tku   boxRootu   protocolu   denyWindowManagerCloseu   titleu   iconnameu   geometryu   rootWindowPositionu   bindu   __multenterboxCancelu   Frameu   packu   TOPu   BOTHu   Messageu	   configureu   PROPORTIONAL_FONT_FAMILYu   PROPORTIONAL_FONT_SIZEu   RIGHTu   entryWidgetsu   rangeu   Labelu   LEFTu   Entryu   entryWidgetu   TEXT_ENTRY_FONT_SIZEu
   bindArrowsu   __multenterboxGetTextu   insertu   BOTTOMu   Buttonu   okButtonu   STANDARD_SELECTION_EVENTSu   cancelButtonu   focus_forceu   mainloopu   destroyu   __multenterboxText(   u   msgu   titleu   fieldsu   valuesu   masku   choicesu   messageFrameu   messageWidgetu   lastWidgetIndexu   widgetIndexu   argFieldNameu   argFieldValueu
   entryFrameu   labelWidgetu   buttonsFrameu   commandButtonu   handleru   selectionEvent(    (    uO   /Users/mwc/Documents/School Work/KS3 Units/Y9/Python/Lesson 1 - Quiz/easygui.pyu   __multfillableboxs  s~      	(



.
.

u   __multfillableboxc             C   s8   g  a  x! t D] } t  j | j ƒ  ƒ q Wt j ƒ  d  S(   N(   u   __multenterboxTextu   entryWidgetsu   appendu   getu   boxRootu   quit(   u   eventu   entryWidget(    (    uO   /Users/mwc/Documents/School Work/KS3 Units/Y9/Python/Lesson 1 - Quiz/easygui.pyu   __multenterboxGetTextã  s    u   __multenterboxGetTextc             C   s   d  a t j ƒ  d  S(   N(   u   Noneu   __multenterboxTextu   boxRootu   quit(   u   event(    (    uO   /Users/mwc/Documents/School Work/KS3 Units/Y9/Python/Lesson 1 - Quiz/easygui.pyu   __multenterboxCancelì  s    u   __multenterboxCancelu   Enter something.c             C   sF   t  |  | d | d d d | d | ƒ} | rB | rB | j ƒ  } n  | S(   u8  
    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 he cancels the operation.

    By default, enterbox strips its result (i.e. removes leading and trailing
    whitespace).  (If you want it not to strip, use keyword argument: strip=False.)
    This makes it easier to test the results of the call::

        reply = enterbox(....)
        if reply:
            ...
        else:
            ...
    u   defaultu   masku   imageu   rootN(   u   __fillableboxu   Noneu   strip(   u   msgu   titleu   defaultu   stripu   imageu   rootu   result(    (    uO   /Users/mwc/Documents/School Work/KS3 Units/Y9/Python/Lesson 1 - Quiz/easygui.pyu   enterboxõ  s    'u   Enter your password.c          
   C   s"   t  |  | | d d d | d | ƒS(   uÔ   
    Show a box in which a user can enter a password.
    The text is masked with asterisks, so the password is not displayed.
    Returns the text that the user entered, or None if he cancels the operation.
    u   masku   *u   imageu   root(   u   __fillablebox(   u   msgu   titleu   defaultu   imageu   root(    (    uO   /Users/mwc/Documents/School Work/KS3 Units/Y9/Python/Lesson 1 - Quiz/easygui.pyu   passwordbox  s    c             C   sì  | d& k r | d k n  | d& k r. d } n  | a t a | rf | j ƒ  t d | ƒ a t j ƒ  n t ƒ  a t j ƒ  t j d t ƒ t j	 | ƒ t j
 d ƒ t j t ƒ t j d t ƒ t d t ƒ } | j d t d t ƒ d& } | rät j j | ƒ } t j j | ƒ \ }	 }
 t j j | ƒ rÍ|
 j ƒ  d' k rWt d t d | ƒ } qát r®y( t j | ƒ } t j | d t ƒ} WqÊ|  t | d t ƒ  f 7}  YqÊXqá|  t | d |
 d f 7}  qä|  t | d f 7}  n  | rUt d t ƒ } | j d t d t ƒ t  | d | ƒ} | | _! | j d t d t" d t# d d d d ƒ n  t d t ƒ } | j d t d t ƒ t d t ƒ } | j d t d t ƒ t d t ƒ } | j d t d t ƒ t$ | d d d |  ƒ} | j% d t& t' f ƒ | j d t( d d d t d d d d ƒ t) | d d ƒa* t+ t* ƒ t* j% d t& t, f ƒ | ret* j% d | ƒ n  t* j d t- d d ƒ t* j d t. ƒ t* j d t ƒ t* j/ d t ƒ t0 | d d d d  ƒa1 t+ t1 ƒ t1 j d d d t- d d d d d! d" d# d ƒ t1 } t. } x" t2 D] } | j d$ | | ƒ qWt0 | d d d d% ƒa3 t+ t3 ƒ t3 j d d d t( d d d d d! d" d# d ƒ t3 } t } x" t2 D] } | j d$ | | ƒ qWt* j4 ƒ  t j5 ƒ  t j6 ƒ  | rÞ| j5 ƒ  n  t j7 ƒ  t S((   uø   
    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 he cancels the operation.
    u    u   masteru   WM_DELETE_WINDOWu   Dialogu   <Escape>u   sideu   fillu   .gifu   .pgmu   .ppmu   fileud   
The Python Imaging Library (PIL) could not convert this file to a displayable image.

PIL reports:
u   
I could not import the Python Imaging Library (PIL) to display the image.

You may need to install PIL
(http://www.pythonware.com/products/pil/)
to display u    image files.u   
Image file not found.u   imageu   expandu   padxu   1mu   padyu   widthu   4.5iu   textu   fonti   u   3mi(   u   showu   <Return>i    u	   takefocusu   OKu   ipadxu   2mu   ipadyu   <%s>u   CancelN(   u   .gifu   .pgmu   .ppm(8   u   Noneu   __enterboxDefaultTextu   __enterboxTextu   withdrawu   Toplevelu   boxRootu   Tku   protocolu   denyWindowManagerCloseu   titleu   iconnameu   geometryu   rootWindowPositionu   bindu   __enterboxCancelu   Frameu   packu   TOPu   BOTHu   osu   pathu   normpathu   splitextu   existsu   loweru
   PhotoImageu   PILisLoadedu   PILImageu   openu
   PILImageTku   ImageErrorMsgu   exception_formatu   Labelu   imageu   YESu   Xu   Messageu	   configureu   PROPORTIONAL_FONT_FAMILYu   PROPORTIONAL_FONT_SIZEu   RIGHTu   Entryu   entryWidgetu
   bindArrowsu   TEXT_ENTRY_FONT_SIZEu   LEFTu   __enterboxGetTextu   insertu   Buttonu   okButtonu   STANDARD_SELECTION_EVENTSu   cancelButtonu   focus_forceu	   deiconifyu   mainloopu   destroy(   u   msgu   titleu   defaultu   masku   imageu   rootu   messageFrameu   tk_Imageu   imageFilenameu   junku   extu	   pil_Imageu
   imageFrameu   labelu   buttonsFrameu
   entryFrameu   messageWidgetu   commandButtonu   handleru   selectionEvent(    (    uO   /Users/mwc/Documents/School Work/KS3 Units/Y9/Python/Lesson 1 - Quiz/easygui.pyu   __fillablebox"  s¤      	
	
			+(

.
.


 
u   __fillableboxc             C   s   t  j ƒ  a t j ƒ  d  S(   N(   u   entryWidgetu   getu   __enterboxTextu   boxRootu   quit(   u   event(    (    uO   /Users/mwc/Documents/School Work/KS3 Units/Y9/Python/Lesson 1 - Quiz/easygui.pyu   __enterboxGetText®  s    u   __enterboxGetTextc             C   s0   t  j d t t  j ƒ  ƒ ƒ t  j d t ƒ d  S(   Ni    (   u   entryWidgetu   deleteu   lenu   getu   insertu   __enterboxDefaultText(   u   event(    (    uO   /Users/mwc/Documents/School Work/KS3 Units/Y9/Python/Lesson 1 - Quiz/easygui.pyu   __enterboxRestoreµ  s    u   __enterboxRestorec             C   s   d  a t j ƒ  d  S(   N(   u   Noneu   __enterboxTextu   boxRootu   quit(   u   event(    (    uO   /Users/mwc/Documents/School Work/KS3 Units/Y9/Python/Lesson 1 - Quiz/easygui.pyu   __enterboxCancel¼  s    u   __enterboxCancelc              C   s+   t  ƒ  }  |  j ƒ  |  j ƒ  |  j ƒ  d S(   u%    don't allow WindowManager close
    N(   u   Tku   withdrawu   bellu   destroy(   u   x(    (    uO   /Users/mwc/Documents/School Work/KS3 Units/Y9/Python/Lesson 1 - Quiz/easygui.pyu   denyWindowManagerCloseÂ  s    	

u   denyWindowManagerCloseu   Pick as many items as you like.c             K   s4   t  | ƒ d k r d g } n  d a t |  | | ƒ S(   uw  
    Present the user with a list of choices.
    allow him to select multiple items and return them in a list.
    if the user doesn't choose anything from the list, return the empty list.
    return None if he cancelled selection.

    @arg msg: the msg to be displayed.
    @arg title: the window title
    @arg choices: a list or tuple of the choices to be displayed
    i    u0   Program logic error - no choices were specified.i   (   u   lenu   __choiceboxMultipleSelectu   __choicebox(   u   msgu   titleu   choicesu   kwargs(    (    uO   /Users/mwc/Documents/School Work/KS3 Units/Y9/Python/Lesson 1 - Quiz/easygui.pyu   multchoiceboxÏ  s     u   Pick something.c             C   s4   t  | ƒ d k r d g } n  d a t |  | | ƒ S(   u  
    Present the user with a list of choices.
    return the choice that he selects.
    return None if he cancels the selection selection.

    @arg msg: the msg to be displayed.
    @arg title: the window title
    @arg choices: a list or tuple of the choices to be displayed
    i    u0   Program logic error - no choices were specified.(   u   lenu   __choiceboxMultipleSelectu   __choicebox(   u   msgu   titleu   choices(    (    uO   /Users/mwc/Documents/School Work/KS3 Units/Y9/Python/Lesson 1 - Quiz/easygui.pyu	   choiceboxè  s     c             C   s  t  | d d … ƒ } t | ƒ d k r4 d g } n  d d g } x. t t | ƒ ƒ D] } t | | ƒ | | <qS Wt t | ƒ d ƒ } d } | d k r¡ d } n  d a t ƒ  a t j	 d t
 ƒ t j ƒ  } t j ƒ  } t | d	 ƒ } t | d
 ƒ }	 t | d ƒ }
 t | d ƒ } t j | ƒ t j d ƒ d } t j | ƒ t t _ t j | |	 ƒ d t |
 ƒ d t | ƒ } t j | ƒ t d t ƒ } | j d t d t d t ƒ t | ƒ } | j d t d t d t ƒ t | ƒ } | j d t d t d d ƒ t d t ƒ } | j d t d t d t ƒ t | d t d |  d t | d ƒ ƒ} | j d t  t! f ƒ | j d t d t d t d d d d ƒ t" | d | d d d d d  d! ƒa# t$ rÒt# j d" t% ƒ n  t# j d t  t! f ƒ t& | d# t' d$ t# j( ƒ} t# j d% | j) ƒ t& | d# t* d$ t# j+ ƒ} t# j d& | j) ƒ | j d t d t ƒ | j d t d t, ƒ t# j d t d d d d d t d t ƒ x. t t | ƒ ƒ D] } t | | ƒ | | <q«Wt- rå| j. d' t j/ ƒ n | j. d( d) „  ƒ d } g  a0 x@ | D]8 } | | k r qt# j1 t2 | ƒ t0 j3 | ƒ | } qWt j4 d* t5 ƒ t | ƒ d k rt6 | d+ t d d d d, d d- ƒ} t7 | ƒ | j d t d t d d. d d d/ d d0 d. ƒ | } t8 } x" t9 D] } | j4 d1 | | ƒ qØWt# j4 d2 t8 ƒ t# j4 d3 t8 ƒ n  t# j4 d2 t: ƒ t# j4 d3 t: ƒ t6 | d+ t d d d d, d d- ƒ} t7 | ƒ | j d t d t d d. d d d/ d d0 d. ƒ | } t: } x" t9 D] } | j4 d1 | | ƒ q¨Wt | ƒ d k rÕt$ rÕt | ƒ } | j d t d t, d t ƒ t6 | d d4 d d, d d- ƒ} t7 | ƒ | j4 d5 t; ƒ | j d t d t d d. d d d/ d d0 d. ƒ t6 | d d6 d d, d d- ƒ} t7 | ƒ | j4 d5 t< ƒ | j d t d t d d. d d d/ d d0 d. ƒ n  t j4 d7 t: ƒ t# j= d ƒ t# j> ƒ  t j? ƒ  t j@ ƒ  t S(8   uE   
    internal routine to support choicebox() and multchoicebox()
    Ni    u0   Program logic error - no choices were specified.u   OKu   Canceli   u    u   WM_DELETE_WINDOWgš™™™™™é?g      à?gš™™™™™¹?gš™™™™™©?u   Dialogu   +0+0u   +u   masteru   sideu   fillu   expandu   padyu   anchoru   textu   widthgÍÌÌÌÌÌì?u   fontu   padxu   1mu   heightu   borderwidthu   reliefu   flatu   bgu   whiteu
   selectmodeu   orientu   commandu   yscrollcommandu   xscrollcommandu   keyc             S   s   t  |  j ƒ  | j ƒ  ƒ S(   N(   u   cmpu   lower(   u   xu   y(    (    uO   /Users/mwc/Documents/School Work/KS3 Units/Y9/Python/Lesson 1 - Quiz/easygui.pyu   <lambda>q  s    u   __choicebox.<locals>.<lambda>u	   <Any-Key>u	   takefocusi   i   u   2mu   ipadyu   ipadxu   <%s>u   <Return>u   <Double-Button-1>u
   Select Allu
   <Button-1>u	   Clear Allu   <Escape>(A   u   listu   lenu   rangeu   stru   minu   Noneu   __choiceboxResultsu   Tku   boxRootu   protocolu   denyWindowManagerCloseu   winfo_screenwidthu   winfo_screenheightu   intu   titleu   iconnameu   geometryu   NOu   expandu   minsizeu   Frameu   packu   TOPu   Xu   LEFTu   YESu   RIGHTu   BOTTOMu   BOTHu   Messageu   NWu	   configureu   PROPORTIONAL_FONT_FAMILYu   PROPORTIONAL_FONT_SIZEu   Listboxu   choiceboxWidgetu   __choiceboxMultipleSelectu   MULTIPLEu	   Scrollbaru   VERTICALu   yviewu   setu
   HORIZONTALu   xviewu   Yu   runningPython3u   sortu   loweru   choiceboxChoicesu   insertu   ENDu   appendu   bindu   KeyboardListeneru   Buttonu
   bindArrowsu   __choiceboxGetChoiceu   STANDARD_SELECTION_EVENTSu   __choiceboxCancelu   __choiceboxSelectAllu   __choiceboxClearAllu
   select_setu   focus_forceu   mainloopu   destroy(   u   msgu   titleu   choicesu   defaultButtonsu   indexu   lines_to_showu   screen_widthu   screen_heightu
   root_widthu   root_heightu	   root_xposu	   root_yposu   rootWindowPositionu   message_and_buttonsFrameu   messageFrameu   buttonsFrameu   choiceboxFrameu   messageWidgetu   rightScrollbaru   bottomScrollbaru   lastInsertedu   choiceu   okButtonu   commandButtonu   handleru   selectionEventu   cancelButtonu   selectionButtonsFrameu   selectAllButtonu   clearAllButton(    (    uO   /Users/mwc/Documents/School Work/KS3 Units/Y9/Python/Lesson 1 - Quiz/easygui.pyu   __choiceboxÿ  sÎ     			((		( 
$
.$
.
.
1


u   __choiceboxc             C   sK   t  r" d d „  t j ƒ  Dƒ a n t j ƒ  } t j | ƒ a t j ƒ  d  S(   Nc             S   s   g  |  ] } t  j | ƒ ‘ q S(    (   u   choiceboxWidgetu   get(   u   .0u   index(    (    uO   /Users/mwc/Documents/School Work/KS3 Units/Y9/Python/Lesson 1 - Quiz/easygui.pyu
   <listcomp>Á  s   	 u(   __choiceboxGetChoice.<locals>.<listcomp>(   u   __choiceboxMultipleSelectu   choiceboxWidgetu   curselectionu   __choiceboxResultsu   getu   boxRootu   quit(   u   eventu   choice_index(    (    uO   /Users/mwc/Documents/School Work/KS3 Units/Y9/Python/Lesson 1 - Quiz/easygui.pyu   __choiceboxGetChoice½  s
    u   __choiceboxGetChoicec             C   s   t  j d t t ƒ d ƒ d  S(   Ni    i   (   u   choiceboxWidgetu   selection_setu   lenu   choiceboxChoices(   u   event(    (    uO   /Users/mwc/Documents/School Work/KS3 Units/Y9/Python/Lesson 1 - Quiz/easygui.pyu   __choiceboxSelectAllÌ  s    u   __choiceboxSelectAllc             C   s   t  j d t t ƒ d ƒ d  S(   Ni    i   (   u   choiceboxWidgetu   selection_clearu   lenu   choiceboxChoices(   u   event(    (    uO   /Users/mwc/Documents/School Work/KS3 Units/Y9/Python/Lesson 1 - Quiz/easygui.pyu   __choiceboxClearAllÑ  s    u   __choiceboxClearAllc             C   s   d  a t j ƒ  d  S(   N(   u   Noneu   __choiceboxResultsu   boxRootu   quit(   u   event(    (    uO   /Users/mwc/Documents/School Work/KS3 Units/Y9/Python/Lesson 1 - Quiz/easygui.pyu   __choiceboxCancelØ  s    u   __choiceboxCancelc             C   s   |  j  } t | ƒ d k rü| t j k rüy t t j ƒ  d ƒ } Wn t k
 r^ d } Yn Xt j d d ƒ x‡t	 | d t t
 ƒ ƒ D]M } t
 | } | d j ƒ  | j ƒ  k r‰ t j d | ƒ t j | ƒ d  Sq‰ Wxa t	 t t
 ƒ ƒ D]M } t
 | } | d j ƒ  | j ƒ  k rí t j d | ƒ t j | ƒ d  Sqí Wx„ t	 t t
 ƒ ƒ D]p } t
 | } | d j ƒ  | j ƒ  k rQ| d k r t j d | d ƒ n t j d d ƒ t j | ƒ d  SqQWt t
 ƒ d } t j d | ƒ t j | ƒ d  Sqün  d  S(   Ni   i    u   endu   firstiÿÿÿÿ(   u   keysymu   lenu   stringu	   printableu   intu   choiceboxWidgetu   curselectionu
   IndexErroru   selection_clearu   rangeu   choiceboxChoicesu   loweru   selection_setu   see(   u   eventu   keyu   start_nu   nu   itemu	   lastIndex(    (    uO   /Users/mwc/Documents/School Work/KS3 Units/Y9/Python/Lesson 1 - Quiz/easygui.pyu   KeyboardListenerß  s@    	 


u   KeyboardListenerc               C   s:   d j  t j t j ƒ  d t j ƒ  d t j ƒ  d ƒ ƒ S(   uD   
    Convert exception info into a string suitable for display.
    u    i    i   i   (   u   joinu	   tracebacku   format_exceptionu   sysu   exc_info(    (    (    uO   /Users/mwc/Documents/School Work/KS3 Units/Y9/Python/Lesson 1 - Quiz/easygui.pyu   exception_format  s    u   exception_formatc             C   sA   | d k r d } n  |  d k r* d }  n  t |  | t ƒ  ƒ d S(   u^  
    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.
    u   Error Reportu1   An error (exception) has occurred in the program.N(   u   Noneu   codeboxu   exception_format(   u   msgu   title(    (    uO   /Users/mwc/Documents/School Work/KS3 Units/Y9/Python/Lesson 1 - Quiz/easygui.pyu   exceptionbox   s
     		c             C   s   t  |  | | d d ƒS(   u  
    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.
    u   codeboxi   (   u   textbox(   u   msgu   titleu   text(    (    uO   /Users/mwc/Documents/School Work/KS3 Units/Y9/Python/Lesson 1 - Quiz/easygui.pyu   codebox5  s    c             C   sí  |  d: k r d }  n  | d: k r* d } n  d g } | d a t ƒ  a t j d t ƒ t j ƒ  } t j ƒ  } t | d ƒ } t | d ƒ } t | d ƒ }	 t | d ƒ }
 t j	 | ƒ t j
 d	 ƒ d
 a t j t ƒ t t _ t j | | ƒ d t |	 ƒ d t |
 ƒ a t j t ƒ t d t ƒ } | j d t d t d t ƒ t | d d ƒ} | j d t d t d t ƒ t | ƒ } | j d t d t d t ƒ t | ƒ } | j d t d t d t ƒ t | ƒ a t j d t d t ƒ | rQt | d t ƒ } t | d d d | d d d d ƒ} | j d t ƒ | j d t t f ƒ n^ t | d t ƒ } t | d d d | d d d d ƒ} | j d t  ƒ | j d t! t" f ƒ | j# d | j$ d t% ƒ ƒ | j# d | j$ d; t% ƒ ƒ | j# d | j& d t% ƒ ƒ | j# d  | j& d< t% ƒ ƒ | j# d! | j$ d t' ƒ ƒ | j# d" | j$ d= t' ƒ ƒ t( | d# t) d$ | j* ƒ} | j d% | j+ ƒ t( | d# t, d$ | j- ƒ} | j d& | j+ ƒ | rÒ| j d t d t ƒ n  | j d t d t. ƒ | j d t d t d t ƒ t/ | d' t0 d( |  d t | d) ƒ ƒ} | j d t! t" f ƒ | j d t d t d t d d d d ƒ t1 t d* t d( d d d d d+ ƒ} | j d t d t d d d d d, d d- d ƒ | } t2 } x+ d. d/ d0 g D] } | j# d1 | | ƒ qØWy{ t3 | ƒ t3 d2 ƒ k rnI y d j4 | ƒ } Wn3 t5 d3 t t3 | ƒ ƒ d4 ƒ t6 j7 d5 ƒ Yn X| j8 t9 | d6 ƒ Wn t5 d7 ƒ t6 j7 d5 ƒ Yn Xy | j: ƒ  Wn t5 d8 ƒ t6 j7 d5 ƒ Yn Xt j; ƒ  | j< d9 t9 ƒ } t j= ƒ  | S(>   u  
    Display some text in a proportional font with line wrapping at word breaks.
    This function is suitable for displaying general written text.

    The text parameter should be a string, or a list or tuple of lines to be
    displayed in the textbox.
    u    u   OKi    u   WM_DELETE_WINDOWgš™™™™™é?g      à?gš™™™™™¹?gš™™™™™©?u   Dialogu   +0+0u   +u   masteru   sideu   fillu   expandu   borderwidthi   g333333ã?u   heighti   u   widthu   padxu   2mu   padyu   1mu   wrapu   fontu   <Next>i   u   <Prior>u   <Right>u   <Left>u   <Down>u   <Up>u   orientu   commandu   yscrollcommandu   xscrollcommandu   anchoru   textgÍÌÌÌÌÌì?u	   takefocusi   u   ipadyu   ipadxu   Returnu   Button-1u   Escapeu   <%s>u   abcu!   Exception when trying to convert u    to text in textAreai   u   normalu+   Exception when trying to load the textArea.u/   Exception when trying to put focus on okButton.g        Niÿÿÿÿiÿÿÿÿiÿÿÿÿ(>   u   Noneu   __replyButtonTextu   Tku   boxRootu   protocolu   denyWindowManagerCloseu   winfo_screenwidthu   winfo_screenheightu   intu   titleu   iconnameu   rootWindowPositionu   geometryu   NOu   expandu   minsizeu   stru   Frameu   packu   TOPu   BOTHu   YESu   BOTTOMu   Xu   LEFTu   buttonsFrameu   RIGHTu   MONOSPACE_FONT_SIZEu   Textu	   configureu   NONEu   MONOSPACE_FONT_FAMILYu   WORDu   PROPORTIONAL_FONT_FAMILYu   PROPORTIONAL_FONT_SIZEu   bindu   yview_scrollu   PAGESu   xview_scrollu   UNITSu	   Scrollbaru   VERTICALu   yviewu   setu
   HORIZONTALu   xviewu   Yu   Messageu   NWu   Buttonu   __textboxOKu   typeu   joinu   msgboxu   sysu   exitu   insertu   ENDu   focus_forceu   mainloopu   getu   destroy(   u   msgu   titleu   textu   codeboxu   choicesu   screen_widthu   screen_heightu
   root_widthu   root_heightu	   root_xposu	   root_yposu	   mainframeu   textboxFrameu   message_and_buttonsFrameu   messageFrameu   character_widthu   textAreau   rightScrollbaru   bottomScrollbaru   messageWidgetu   okButtonu   commandButtonu   handleru   selectionEventu   areaText(    (    uO   /Users/mwc/Documents/School Work/KS3 Units/Y9/Python/Lesson 1 - Quiz/easygui.pyu   textboxF  s´     	 		
		$		(($. 



c             C   s   t  j ƒ  d  S(   N(   u   boxRootu   quit(   u   event(    (    uO   /Users/mwc/Documents/School Work/KS3 Units/Y9/Python/Lesson 1 - Quiz/easygui.pyu   __textboxOKè  s    u   __textboxOKc          	   C   sy   t  |  | ƒ } t ƒ  } | j ƒ  | s1 d } n  t j d | d | d | d d ƒ } | j ƒ  | si d St j j	 | ƒ S(   u:  
    A dialog to get a directory name.
    Note that the msg argument, if specified, is ignored.

    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.
    u   parentu   titleu
   initialdiru   initialfileN(
   u   getFileDialogTitleu   Tku   withdrawu   Noneu   tk_FileDialogu   askdirectoryu   destroyu   osu   pathu   normpath(   u   msgu   titleu   defaultu	   localRootu   f(    (    uO   /Users/mwc/Documents/School Work/KS3 Units/Y9/Python/Lesson 1 - Quiz/easygui.pyu
   diropenboxñ  s    	
 			
 c             C   sL   |  r | r d | |  f S|  r1 | r1 t  |  ƒ S| rH |  rH t  | ƒ Sd  S(   Nu   %s - %s(   u   stru   None(   u   msgu   title(    (    uO   /Users/mwc/Documents/School Work/KS3 Units/Y9/Python/Lesson 1 - Quiz/easygui.pyu   getFileDialogTitle  s      
 
u   getFileDialogTitlec             B   sh   |  Ee  Z d  Z d d „  Z d d „  Z d d „  Z d d „  Z d	 d
 „  Z d d „  Z d d „  Z	 d S(   u   FileTypeObjectc             C   sÐ   t  | ƒ d k r! t d ƒ ‚ n  g  |  _ t | ƒ t d ƒ k rR |  j | ƒ nz t | ƒ t g  ƒ k r¼ t  | ƒ d k  r“ t d d | ƒ ‚ qÌ | d	 |  _ t | d  d
 … ƒ |  _ n t d | ƒ ‚ d  S(   Ni    u   Filetype argument is empty.u   abci   u   Invalid filemask.
u'   List contains less than 2 members: "%s"i   u   Invalid filemask: "%s"iÿÿÿÿiÿÿÿÿ(   u   lenu   AssertionErroru   masksu   typeu   initializeFromStringu   nameu   list(   u   selfu   filemask(    (    uO   /Users/mwc/Documents/School Work/KS3 Units/Y9/Python/Lesson 1 - Quiz/easygui.pyu   __init__  s    	u   FileTypeObject.__init__c             C   s   |  j  | j  k r d Sd S(   NTF(   u   nameu   Trueu   False(   u   selfu   other(    (    uO   /Users/mwc/Documents/School Work/KS3 Units/Y9/Python/Lesson 1 - Quiz/easygui.pyu   __eq__0  s     u   FileTypeObject.__eq__c             C   s:   x3 | j  D]( } | |  j  k r" q
 |  j  j | ƒ q
 Wd  S(   N(   u   masksu   append(   u   selfu   otheru   mask(    (    uO   /Users/mwc/Documents/School Work/KS3 Units/Y9/Python/Lesson 1 - Quiz/easygui.pyu   add4  s     u   FileTypeObject.addc             C   s   |  j  t |  j ƒ f S(   N(   u   nameu   tupleu   masks(   u   self(    (    uO   /Users/mwc/Documents/School Work/KS3 Units/Y9/Python/Lesson 1 - Quiz/easygui.pyu   toTuple9  s    u   FileTypeObject.toTuplec             C   s   |  j  d k r d Sd S(   Nu	   All filesTF(   u   nameu   Trueu   False(   u   self(    (    uO   /Users/mwc/Documents/School Work/KS3 Units/Y9/Python/Lesson 1 - Quiz/easygui.pyu   isAll<  s     u   FileTypeObject.isAllc             C   su   t  j j | ƒ d |  _ |  j d k r4 d |  _ n  |  j d k rO d |  _ n  |  j ƒ  |  _ d |  j g |  _ d  S(   Ni   u    u   .*u   .u   *(   u   osu   pathu   splitextu   extu   getNameu   nameu   masks(   u   selfu   filemask(    (    uO   /Users/mwc/Documents/School Work/KS3 Units/Y9/Python/Lesson 1 - Quiz/easygui.pyu   initializeFromString@  s      u#   FileTypeObject.initializeFromStringc             C   sŽ   |  j  } | d k r d S| d k r) d S| d k r9 d S| d k rI d S| d k rY d	 S| j d
 ƒ r€ | d d  … j ƒ  d S| j ƒ  d S(   Nu   .*u	   All filesu   .txtu
   Text filesu   .pyu   Python filesu   .pycu   .xlsu   Excel filesu   .i   u    files(   u   extu
   startswithu   upper(   u   selfu   e(    (    uO   /Users/mwc/Documents/School Work/KS3 Units/Y9/Python/Lesson 1 - Quiz/easygui.pyu   getNameH  s    	     u   FileTypeObject.getNameN(
   u   __name__u
   __module__u   __qualname__u   __init__u   __eq__u   addu   toTupleu   isAllu   initializeFromStringu   getName(   u
   __locals__(    (    uO   /Users/mwc/Documents/School Work/KS3 Units/Y9/Python/Lesson 1 - Quiz/easygui.pyu   FileTypeObject  s   u   FileTypeObjectc       	      C   sÍ   t  ƒ  } | j ƒ  t | | ƒ \ } } } } | j d ƒ d k  ra | j d ƒ d k  ra d	 } n | d k rv d	 } n  t j d | d t |  | ƒ d | d | d | ƒ } | j ƒ  | s½ d	 St	 j
 j | ƒ S(
   uO  
    A dialog to get a file name.

    About the "default" argument
    ============================
        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 THAT
    =========

        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.

    @rtype: string or None
    @return: the name of a file, or None if user chose to cancel

    @arg msg: the msg to be displayed.
    @arg title: the window title
    @arg default: filepath with wildcards
    @arg filetypes: filemasks that a user can choose, e.g. "*.txt"
    u   *i    u   ?u   parentu   titleu
   initialdiru   initialfileu	   filetypesN(   u   Tku   withdrawu   fileboxSetupu   findu   Noneu   tk_FileDialogu   askopenfilenameu   getFileDialogTitleu   destroyu   osu   pathu   normpath(	   u   msgu   titleu   defaultu	   filetypesu	   localRootu   initialbaseu   initialfileu
   initialdiru   f(    (    uO   /Users/mwc/Documents/School Work/KS3 Units/Y9/Python/Lesson 1 - Quiz/easygui.pyu   fileopenboxW  s     =	
*			
 c       	      C   s…   t  ƒ  } | j ƒ  t | | ƒ \ } } } } t j d | d t |  | ƒ d | d | d | ƒ } | j ƒ  | su d St j	 j
 | ƒ S(   u  
    A file to get the name of a file to save.
    Returns the name of a file, or None if user chose to cancel.

    The "default" argument should contain a filename (i.e. the
    current name of the file to be saved).  It may also be empty,
    or contain a filemask that includes wildcards.

    The "filetypes" argument works like the "filetypes" argument to
    fileopenbox.
    u   parentu   titleu   initialfileu
   initialdiru	   filetypesN(   u   Tku   withdrawu   fileboxSetupu   tk_FileDialogu   asksaveasfilenameu   getFileDialogTitleu   destroyu   Noneu   osu   pathu   normpath(	   u   msgu   titleu   defaultu	   filetypesu	   localRootu   initialbaseu   initialfileu
   initialdiru   f(    (    uO   /Users/mwc/Documents/School Work/KS3 Units/Y9/Python/Lesson 1 - Quiz/easygui.pyu   filesavebox´  s    	
	
 c             C   sª  |  s t  j j d d ƒ }  n  t  j j |  ƒ \ } } | sE d } n  | sT d } n  t  j j | ƒ \ } } t | ƒ } t d ƒ } d } | s™ g  } n  g  }	 xX | D]P }
 t |
 ƒ } | j ƒ  rÍ d } n  | | k ré | j	 | ƒ q¦ |	 j
 | ƒ q¦ W| rn | | k rn |	 j d | ƒ t |	 ƒ d k rD|	 j
 | ƒ n  | |	 d |	 d	 f k ran& t rw|	 j
 | ƒ n |	 j d | ƒ d d „  |	 Dƒ } | | | | f S(
   Nu   .u   *i    i   c             S   s   g  |  ] } | j  ƒ  ‘ q S(    (   u   toTuple(   u   .0u   fto(    (    uO   /Users/mwc/Documents/School Work/KS3 Units/Y9/Python/Lesson 1 - Quiz/easygui.pyu
   <listcomp>  s   	 u    fileboxSetup.<locals>.<listcomp>FTiÿÿÿÿ(   u   osu   pathu   joinu   splitu   splitextu   FileTypeObjectu   Falseu   isAllu   Trueu   addu   appendu   insertu   lenu   runningPython26(   u   defaultu	   filetypesu
   initialdiru   initialfileu   initialbaseu
   initialextu   initialFileTypeObjectu   allFileTypeObjectu   ALL_filetypes_was_specifiedu   filetypeObjectsu   filemasku   fto(    (    uO   /Users/mwc/Documents/School Work/KS3 Units/Y9/Python/Lesson 1 - Quiz/easygui.pyu   fileboxSetupÚ  sF      	 	 		u   fileboxSetupc             C   s   t  |  j a t j ƒ  d S(   uJ   
    Handle an event that is generated by a person clicking a button.
    N(   u   __widgetTextsu   widgetu   __replyButtonTextu   boxRootu   quit(   u   event(    (    uO   /Users/mwc/Documents/School Work/KS3 Units/Y9/Python/Lesson 1 - Quiz/easygui.pyu   __buttonEvent  s    u   __buttonEventc             C   sÍ   d a i  a d } x´ |  D]¬ } t t d d d | ƒ} t | ƒ | j d t d t d d d	 d d
 d d d ƒ | t | <| d k r” | a d } n  | } t	 } x" t
 D] } | j d | | ƒ q§ Wq Wd S(   u)   Put the buttons in the buttons frame
    i    u	   takefocusi   u   textu   expandu   sideu   padxu   1mu   padyu   ipadxu   2mu   ipadyu   <%s>N(   u   Noneu   __firstWidgetu   __widgetTextsu   Buttonu   buttonsFrameu
   bindArrowsu   packu   YESu   LEFTu   __buttonEventu   STANDARD_SELECTION_EVENTSu   bind(   u   choicesu   iu
   buttonTextu
   tempButtonu   commandButtonu   handleru   selectionEvent(    (    uO   /Users/mwc/Documents/School Work/KS3 Units/Y9/Python/Lesson 1 - Quiz/easygui.pyu   __put_buttons_in_buttonframe  s    
.
	u   __put_buttons_in_buttonframec             B   sV   |  Ee  Z d  Z d Z d d „  Z d d „  Z d d „  Z d d	 „  Z d
 d „  Z d S(   u   EgStoreu°  
A class to support persistent storage.

You can use EgStore to support the storage and retrieval
of user settings for an EasyGui application.


# Example A
#-----------------------------------------------------------------------
# define a class named Settings as a subclass of EgStore
#-----------------------------------------------------------------------
class Settings(EgStore):
::
    def __init__(self, filename):  # filename is required
        #-------------------------------------------------
        # Specify default/initial values for variables that
        # this particular application wants to remember.
        #-------------------------------------------------
        self.userId = ""
        self.targetServer = ""

        #-------------------------------------------------
        # For subclasses of EgStore, these must be
        # the last two statements in  __init__
        #-------------------------------------------------
        self.filename = filename  # this is required
        self.restore()            # restore values from the storage file if possible



# Example B
#-----------------------------------------------------------------------
# create settings, a persistent Settings object
#-----------------------------------------------------------------------
settingsFile = "myApp_settings.txt"
settings = Settings(settingsFile)

user    = "obama_barak"
server  = "whitehouse1"
settings.userId = user
settings.targetServer = server
settings.store()    # persist the settings

# run code that gets a new value for userId, and persist the settings
user    = "biden_joe"
settings.userId = user
settings.store()


# Example C
#-----------------------------------------------------------------------
# recover the Settings instance, change an attribute, and store it again.
#-----------------------------------------------------------------------
settings = Settings(settingsFile)
settings.userId = "vanrossum_g"
settings.store()

c             C   s   d  |  _ t ƒ  ‚ d  S(   N(   u   Noneu   filenameu   NotImplementedError(   u   selfu   filename(    (    uO   /Users/mwc/Documents/School Work/KS3 Units/Y9/Python/Lesson 1 - Quiz/easygui.pyu   __init__{  s    	u   EgStore.__init__c          
   C   s¹   t  j j |  j ƒ s |  St  j j |  j ƒ s2 |  Syx t |  j d ƒ } t j | ƒ } | j ƒ  xF t	 |  j
 j ƒ  ƒ D]/ } |  j
 | } | j
 j | | ƒ |  j
 | <qv WWn Yn X|  S(   uy  
        Set the values of whatever attributes are recoverable
        from the pickle file.

        Populate the attributes (the __dict__) of the EgStore object
        from     the attributes (the __dict__) of the pickled object.

        If the pickled object has attributes that have been initialized
        in the EgStore object, then those attributes of the EgStore object
        will be replaced by the values of the corresponding attributes
        in the pickled object.

        If the pickled object is missing some attributes that have
        been initialized in the EgStore object, then those attributes
        of the EgStore object will retain the values that they were
        initialized with.

        If the pickled object has some attributes that were not
        initialized in the EgStore object, then those attributes
        will be ignored.

        IN SUMMARY:

        After the recover() operation, the EgStore object will have all,
        and only, the attributes that it had when it was initialized.

        Where possible, those attributes will have values recovered
        from the pickled object.
        u   rb(   u   osu   pathu   existsu   filenameu   isfileu   openu   pickleu   loadu   closeu   listu   __dict__u   keysu   get(   u   selfu   fu   unpickledObjectu   keyu   default(    (    uO   /Users/mwc/Documents/School Work/KS3 Units/Y9/Python/Lesson 1 - Quiz/easygui.pyu   restore  s      
$u   EgStore.restorec             C   s0   t  |  j d ƒ } t j |  | ƒ | j ƒ  d S(   uÃ   
        Save the attributes of the EgStore object to a pickle file.
        Note that if the directory for the pickle file does not already exist,
        the store operation will fail.
        u   wbN(   u   openu   filenameu   pickleu   dumpu   close(   u   selfu   f(    (    uO   /Users/mwc/Documents/School Work/KS3 Units/Y9/Python/Lesson 1 - Quiz/easygui.pyu   store­  s    u   EgStore.storec             C   s,   t  j j |  j ƒ r( t  j |  j ƒ n  d S(   uM   
        Delete my persistent file (i.e. pickle file), if it exists.
        N(   u   osu   pathu   isfileu   filenameu   remove(   u   self(    (    uO   /Users/mwc/Documents/School Work/KS3 Units/Y9/Python/Lesson 1 - Quiz/easygui.pyu   kill¸  s    u   EgStore.killc             C   s¯   d } g  } x9 |  j  j ƒ  D]( } | j | ƒ t | t | ƒ ƒ } q W| j ƒ  g  } xG | D]? } |  j  | } | j | ƒ } | j d | t | ƒ f ƒ q_ Wd j | ƒ S(   uK   
        return my contents as a string in an easy-to-read format.
        i    u   %s : %s
u    (	   u   __dict__u   keysu   appendu   maxu   lenu   sortu   ljustu   repru   join(   u   selfu   longest_key_lengthu   keysu   keyu   linesu   value(    (    uO   /Users/mwc/Documents/School Work/KS3 Units/Y9/Python/Lesson 1 - Quiz/easygui.pyu   __str__À  s    
!u   EgStore.__str__N(	   u   __name__u
   __module__u   __qualname__u   __doc__u   __init__u   restoreu   storeu   killu   __str__(   u
   __locals__(    (    uO   /Users/mwc/Documents/School Work/KS3 Units/Y9/Python/Lesson 1 - Quiz/easygui.pyu   EgStore@  s   :.c              C   s¼  t  d d ƒ d d t j d t d t t ƒ }  x€d d d	 d
 d d d d d d d d d d d d d d d d d d d g } t d |  d d  t d! | ƒ } | s¬ d" S| j ƒ  } | d# d k rî t d$ d% ƒ } t  d& t	 | ƒ ƒ q8 | d# d' k r
t
 ƒ  } q8 | d# d( k r$t ƒ  q8 | d# d k rt ƒ  } t  d& t	 | ƒ ƒ d) } d* } t d | d | d! | ƒ } t  d& t	 | ƒ ƒ q8 | d# d+ k r©t ƒ  q8 | d# d k rÙt ƒ  } t  d& t	 | ƒ ƒ q8 | d# d k rsd, } d- } t | d. d/ ƒ } t  d& t	 | ƒ ƒ d0 } t | d. d/ d1 d ƒ} t  d& t	 | ƒ ƒ t d2 d3 ƒ } t  d& t	 | ƒ ƒ q8 | d# d4 k r»d, } d5 } t | d6 d7 | ƒ} t  d& t	 | ƒ ƒ q8 | d# d k rîy d8 d# } Wqµt ƒ  YqµXq8 | d# d k rPt d9 d: d; d< d= ƒ } t  d& t	 | ƒ ƒ t d> d? ƒ } t  d& t	 | ƒ ƒ q8 | d# d k rjt ƒ  q8 | d# d k r„t ƒ  q8 | d# d k ržt ƒ  q8 | d# d k r| d# } d@ | d# } dA dB dC dD g } t | | | ƒ } t  d& t	 | ƒ ƒ q8 | d# d k ret dE dF dG ƒ } t  d& t | ƒ ƒ t dH dF dG dI ƒ } t  d& t | ƒ ƒ q8 | d# d k rNdJ } dK } dL dM dN dO dP g }	 g  }
 t | | |	 ƒ }
 x† |
 d" k rÁPn  dQ } xE t t |	 ƒ ƒ D]1 } |
 | j ƒ  dQ k rÚ| dR |	 | } qÚqÚW| dQ k rPn  t | | |	 |
 ƒ }
 q±t  d& t |
 ƒ ƒ q8 | d# d k r1dS } dT } dU dV dW g }	 g  }
 t | | |	 ƒ }
 x† |
 d" k r¤Pn  dQ } xE t t |	 ƒ ƒ D]1 } |
 | j ƒ  dQ k r½| dR |	 | } q½q½W| dQ k rPn  t | | |	 |
 ƒ }
 q”t  d& t |
 ƒ ƒ q8 | d# d k r‰dX } dY } t | | ƒ } t  d& t	 | ƒ ƒ | rµt dZ d[ ƒ qµq8 | d# d k rÅd\ } t | | ƒ } t  d& t	 | ƒ ƒ q8 | d# d
 k rÜd] } d^ d_ } d` da db dc dd | dd de df dg dh di dj dk dl dm d` dn do dp dq dr ds dt du g } dv dw dx dy dz } t d | d! | ƒ } t  d& t	 | ƒ ƒ dv } t d | d | d! | ƒ } t  d& t	 | ƒ ƒ dv } t d d{ d! g  ƒ } t  d& t	 | ƒ ƒ q8 | d# d k rZdd de df dg dh di dj dk dl dm d` dn do dp dq dr ds dt du g } d| } t  | d} | ƒ } t  d& t	 | ƒ ƒ q8 | d# d k r{t! | d# ƒ q8 | d# d k rœt" | d# ƒ q8 t d~ | d d€ ƒ d" Sq8 d" S(‚   u   
    Run the EasyGui demo.
    u   
id   u,   Pick the kind of box that you wish to demo.
u   
 * Python version u   
 * EasyGui version u   
 * Tk version u   msgboxu	   buttonboxu6   buttonbox(image) -- a buttonbox that displays an imageu	   choiceboxu   multchoiceboxu   textboxu   ynboxu   ccboxu   enterboxu5   enterbox(image) -- an enterbox that displays an imageu   exceptionboxu   codeboxu
   integerboxu   boolboxu   indexboxu   filesaveboxu   fileopenboxu   passwordboxu   multenterboxu   multpasswordboxu
   diropenboxu   About EasyGuiu    Helpu   msgu   titleu   EasyGui u   choicesNi    u	   short msgu   This is a long titleu   Reply was: %su   Aboutu   Helpu*   Demo of Buttonbox with many, many buttons!uD   This buttonbox shows what happens when you specify too many buttons.u   buttonbox(image)u   python_and_check_logo.gifu>   Enter the name of your best friend.
(Result will be stripped.)u   Love!u        Suzy Smith     uB   Enter the name of your best friend.
(Result will NOT be stripped.)u   stripu#   Enter the name of your worst enemy:u   Hate!u   enterbox(image)u   What kind of snake is this?u   Quizu   imagei   u    Enter a number between 3 and 333u%   Demo: integerbox WITH a default valueiÞ   i   iM  u   Enter a number between 0 and 99u(   Demo: integerbox WITHOUT a default valueu   Demo of u   Choice1u   Choice2u   Choice3u   Choice4u$   Demo of password box WITHOUT defaultu   

Enter your secret passwordu   Member Logonu!   Demo of password box WITH defaultu   alfieu   Enter your personal informationu   Credit Card Applicationu   Nameu   Street Addressu   Cityu   Stateu   ZipCodeu    u   "%s" is a required field.

u   Enter logon informationu   Demo of multpasswordboxu	   Server IDu   User IDu   Passwordu   Demo of ynboxu+   Were you expecting the Spanish Inquisition?u'   NOBODY expects the Spanish Inquisition!u   Wrong!u   Demo of ccboxu   Demo of choiceboxuQ   This is an example of a very long option which you may or may not wish to choose.i   u   nnnu   dddu   eeeu   fffu   aaau   bbbu   cccu   gggu   hhhu   iiiu   jjju   kkku   LLLu   mmmu   ooou   pppu   qqqu   rrru   sssu   tttu   uuuu   vvvu   Pick something. u   A wrapable sentence of text ?! i   u   
A separate line of text.i   u   The list of choices is empty!u!   Pick as many choices as you wish.u   Demo of multchoiceboxu   Choice

u   

is not recognizedu   Program Logic ErrorF(#   u   writelnu   sysu   versionu	   egversionu   stru	   TkVersionu	   choiceboxu   splitu   msgboxu   repru   abouteasyguiu
   _demo_helpu	   buttonboxu   _demo_buttonbox_with_imageu   boolboxu   enterboxu   Falseu   exceptionboxu
   integerboxu   _demo_diropenboxu   _demo_fileopenboxu   _demo_filesaveboxu   indexboxu   passwordboxu   multenterboxu   Noneu   rangeu   lenu   stripu   multpasswordboxu   ynboxu   ccboxu   multchoiceboxu   _demo_textboxu   _demo_codebox(   u   intro_messageu   choicesu   choiceu   replyu   titleu   msgu   imageu   messageu#   thisWillCauseADivideByZeroExceptionu
   fieldNamesu   fieldValuesu   errmsgu   iu
   longchoiceu   listChoices(    (    uO   /Users/mwc/Documents/School Work/KS3 Units/Y9/Python/Lesson 1 - Quiz/easygui.pyu   egdemoÛ  sX   '	
	 
	
		 
 
 

    
?  c             C   sL   d d d d } d } d d } t  | | | ƒ }  t d t |  ƒ ƒ d  S(	   NuÉ   It was the best 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! i   u   

i
   u   Demo of textboxu   Here is some sample text. i   u   Reply was: %s(   u   textboxu   writelnu   str(   u   replyu   text_snippetu   titleu   msg(    (    uO   /Users/mwc/Documents/School Work/KS3 Units/Y9/Python/Lesson 1 - Quiz/easygui.pyu   _demo_textbox¹  s    
u   _demo_textboxc             C   sJ   d d d d d } d d } t  | d | ƒ }  t d t |  ƒ ƒ d  S(	   NuD   dafsdfa dasflkj pp[oadsij asdfp;ij asdfpjkop asdfpok asdfpok asdfpoki   u   
uË   # here is some dummy Python code
for someItem in myListOfStuff:
    do something(someItem)
    do something()
    do something()
    if somethingElse(someItem):
        doSomethingEvenMoreInteresting()

i   u   Here is some sample code. u   Code Sampleu   Reply was: %s(   u   codeboxu   writelnu   repr(   u   replyu   code_snippetu   msg(    (    uO   /Users/mwc/Documents/School Work/KS3 Units/Y9/Python/Lesson 1 - Quiz/easygui.pyu   _demo_codeboxÂ  s
    	
u   _demo_codeboxc              C   sf   d }  d d d g } xJ d d d d g D]6 } t  |  | d	 | d
 | ƒ} t d t | ƒ ƒ q( Wd  S(   Nu    Do you like this picture?
It is u   Yesu   Nou
   No opinionu   python_and_check_logo.gifu   python_and_check_logo.jpgu   python_and_check_logo.pngu	   zzzzz.gifu   imageu   choicesu   Reply was: %s(   u	   buttonboxu   writelnu   repr(   u   msgu   choicesu   imageu   reply(    (    uO   /Users/mwc/Documents/School Work/KS3 Units/Y9/Python/Lesson 1 - Quiz/easygui.pyu   _demo_buttonbox_with_imageÒ  s    u   _demo_buttonbox_with_imagec              C   sF   t  j }  t ƒ  t  _ } t d ƒ |  t  _ t d d | j ƒ  ƒd  S(   Nu   easyguiu   EasyGui Helpu   text(   u   sysu   stdoutu   StringIOu   helpu   codeboxu   getvalue(   u   savedStdoutu   capturedOutput(    (    uO   /Users/mwc/Documents/School Work/KS3 Units/Y9/Python/Lesson 1 - Quiz/easygui.pyu
   _demo_helpá  s
    	
	u
   _demo_helpc              C   s9   d }  d } d } t  | | d |  ƒ} t d | ƒ d  S(   Nu   myNewFile.txtu   File SaveAsu   Save file as:u   defaultu   You chose to save file: %s(   u   filesaveboxu   writeln(   u   filenameu   titleu   msgu   f(    (    uO   /Users/mwc/Documents/School Work/KS3 Units/Y9/Python/Lesson 1 - Quiz/easygui.pyu   _demo_filesaveboxè  s
    u   _demo_filesaveboxc              C   ss   d }  d } t  | |  ƒ } t d | ƒ t  | |  d d ƒ} t d | ƒ t  | |  d d ƒ} t d | ƒ d  S(   Nu   Demo of diropenboxu)   Pick the directory that you wish to open.u   You chose directory...: %su   defaultu   ./u   c:/(   u
   diropenboxu   writeln(   u   titleu   msgu   d(    (    uO   /Users/mwc/Documents/School Work/KS3 Units/Y9/Python/Lesson 1 - Quiz/easygui.pyu   _demo_diropenboxð  s    u   _demo_diropenboxc              C   sŒ   d }  d } d } t  |  | d | ƒ} t d | ƒ d } d d d	 d
 d g d d d g g } t  |  | d | d | ƒ} t d | ƒ d  S(   Nu   Python filesu
   Open filesu   *.pyu   defaultu   You chose to open file: %su   ./*.gifu   *.jpgu   *.zipu   *.tgsu   *.gzu   Archive filesu   *.htmu   *.htmlu
   HTML filesu	   filetypes(   u   fileopenboxu   writeln(   u   msgu   titleu   defaultu   fu	   filetypes(    (    uO   /Users/mwc/Documents/School Work/KS3 Units/Y9/Python/Lesson 1 - Quiz/easygui.pyu   _demo_fileopenboxý  s    $u   _demo_fileopenboxc               C   s   d  S(   N(    (    (    (    uO   /Users/mwc/Documents/School Work/KS3 Units/Y9/Python/Lesson 1 - Quiz/easygui.pyu   _dummy	  s    u   _dummyu!  
========================================================================
0.96(2010-08-29)
========================================================================
This version fixes some problems with version independence.

BUG FIXES
------------------------------------------------------
 * A statement with Python 2.x-style exception-handling syntax raised
   a syntax error when running under Python 3.x.
   Thanks to David Williams for reporting this problem.

 * Under some circumstances, PIL was unable to display non-gif images
   that it should have been able to display.
   The cause appears to be non-version-independent import syntax.
   PIL modules are now imported with a version-independent syntax.
   Thanks to Horst Jens for reporting this problem.

LICENSE CHANGE
------------------------------------------------------
Starting with this version, 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.
Earlier versions were licensed under the Creative Commons Attribution License 2.0.


========================================================================
0.95(2010-06-12)
========================================================================

ENHANCEMENTS
------------------------------------------------------
 * Previous versions of EasyGui could display only .gif image files using the
   msgbox "image" argument. This version can now display all image-file formats
   supported by PIL the Python Imaging Library) if PIL is installed.
   If msgbox is asked to open a non-gif image file, it attempts to import
   PIL and to use PIL to convert the image file to a displayable format.
   If PIL cannot be imported (probably because PIL is not installed)
   EasyGui displays an error message saying that PIL must be installed in order
   to display the image file.

   Note that
   http://www.pythonware.com/products/pil/
   says that PIL doesn't yet support Python 3.x.


========================================================================
0.94(2010-06-06)
========================================================================

ENHANCEMENTS
------------------------------------------------------
 * The codebox and textbox functions now return the contents of the box, rather
   than simply the name of the button ("Yes").  This makes it possible to use
   codebox and textbox as data-entry widgets.  A big "thank you!" to Dominic
   Comtois for requesting this feature, patiently explaining his requirement,
   and helping to discover the tkinter techniques to implement it.

   NOTE THAT in theory this change breaks backward compatibility.  But because
   (in previous versions of EasyGui) the value returned by codebox and textbox
   was meaningless, no application should have been checking it.  So in actual
   practice, this change should not break backward compatibility.

 * Added support for SPACEBAR to command buttons.  Now, when keyboard
   focus is on a command button, a press of the SPACEBAR will act like
   a press of the ENTER key; it will activate the command button.

 * Added support for keyboard navigation with the arrow keys (up,down,left,right)
   to the fields and buttons in enterbox, multenterbox and multpasswordbox,
   and to the buttons in choicebox and all buttonboxes.

 * added highlightthickness=2 to entry fields in multenterbox and
   multpasswordbox.  Now it is easier to tell which entry field has
   keyboard focus.


BUG FIXES
------------------------------------------------------
 * In EgStore, the pickle file is now opened with "rb" and "wb" rather than
   with "r" and "w".  This change is necessary for compatibility with Python 3+.
   Thanks to Marshall Mattingly for reporting this problem and providing the fix.

 * In integerbox, the actual argument names did not match the names described
   in the docstring. Thanks to Daniel Zingaro of at University of Toronto for
   reporting this problem.

 * In integerbox, the "argLowerBound" and "argUpperBound" arguments have been
   renamed to "lowerbound" and "upperbound" and the docstring has been corrected.

   NOTE THAT THIS CHANGE TO THE ARGUMENT-NAMES BREAKS BACKWARD COMPATIBILITY.
   If argLowerBound or argUpperBound are used, an AssertionError with an
   explanatory error message is raised.

 * In choicebox, the signature to choicebox incorrectly showed choicebox as
   accepting a "buttons" argument.  The signature has been fixed.


========================================================================
0.93(2009-07-07)
========================================================================

ENHANCEMENTS
------------------------------------------------------

 * Added exceptionbox to display stack trace of exceptions

 * modified names of some font-related constants to make it
   easier to customize them


========================================================================
0.92(2009-06-22)
========================================================================

ENHANCEMENTS
------------------------------------------------------

 * Added EgStore class to to provide basic easy-to-use persistence.

BUG FIXES
------------------------------------------------------

 * 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.

c               C   s   t  d t d t ƒ d S(   u,   
    shows the easygui revision history
    u   About EasyGui
u   EasyGuiN(   u   codeboxu	   egversionu   EASYGUI_ABOUT_INFORMATIONu   None(    (    (    uO   /Users/mwc/Documents/School Work/KS3 Units/Y9/Python/Lesson 1 - Quiz/easygui.pyu   abouteasygui	  s    u   __main__TF(   u   MSu   Sansu   Serif(   u   Yesu   No(   u   Continueu   Cancel(   u   Yesu   No(   u   Yesu   No(   u   Button1u   Button2u   Button3(r   u   __doc__u   splitu	   egversionu   __all__u   sysu   osu   stringu   pickleu	   tracebacku
   hexversionu   Trueu   runningPython26u   Falseu   runningPython3u   PILu   Imageu   PILImageu   ImageTku
   PILImageTku   PILisLoadedu   tkinteru   tkinter.filedialogu
   filedialogu   tk_FileDialogu   iou   StringIOu   Tkinteru   tkFileDialogu   writeu   writelnu   sayu	   TkVersionu   starsu   stru   exitu   dqu   rootWindowPositionu   PROPORTIONAL_FONT_FAMILYu   MONOSPACE_FONT_FAMILYu   PROPORTIONAL_FONT_SIZEu   MONOSPACE_FONT_SIZEu   TEXT_ENTRY_FONT_SIZEu   STANDARD_SELECTION_EVENTSu   Noneu   __choiceboxMultipleSelectu   __widgetTextsu   __replyButtonTextu   __choiceboxResultsu   __firstWidgetu   __enterboxTextu   __enterboxDefaultTextu   __multenterboxTextu   choiceboxChoicesu   choiceboxWidgetu   entryWidgetu   boxRootu   ImageErrorMsgu   ynboxu   ccboxu   boolboxu   indexboxu   msgboxu	   buttonboxu
   integerboxu   multenterboxu   tupleu   multpasswordboxu
   bindArrowsu   tabRightu   tabLeftu   __multfillableboxu   __multenterboxGetTextu   __multenterboxCancelu   enterboxu   passwordboxu   __fillableboxu   __enterboxGetTextu   __enterboxRestoreu   __enterboxCancelu   denyWindowManagerCloseu   multchoiceboxu	   choiceboxu   __choiceboxu   __choiceboxGetChoiceu   __choiceboxSelectAllu   __choiceboxClearAllu   __choiceboxCancelu   KeyboardListeneru   exception_formatu   exceptionboxu   codeboxu   textboxu   __textboxOKu
   diropenboxu   getFileDialogTitleu   FileTypeObjectu   fileopenboxu   filesaveboxu   fileboxSetupu   __buttonEventu   __put_buttons_in_buttonframeu   EgStoreu   egdemou   _demo_textboxu   _demo_codeboxu   _demo_buttonbox_with_imageu
   _demo_helpu   _demo_filesaveboxu   _demo_diropenboxu   _demo_fileopenboxu   _dummyu   EASYGUI_ABOUT_INFORMATIONu   abouteasyguiu   __name__(    (    (    uO   /Users/mwc/Documents/School Work/KS3 Units/Y9/Python/Lesson 1 - Quiz/easygui.pyu   <module>I   s„  			



%	aS0 l		‡¾4Ÿ	;Z#;	"›Þ	€	