
    wZi;                        S r SSKrSSKr SSKJr  SSKJr  SSKJ	r	  SSK
Jr  SSKJr  SS	KJr  SS
KJr  SSKJr  SSKJr  SSKJr  SSKJr  SSKJr  SSKJr  SSKJr  SSKJr  SSKJr  SSKJr  SSKJr  SSKJr  SSKJ r   SSKJ!r!  SSK!J"r"  SSK!J#r#  \RR                  RU                  \RR                  RU                  \RR                  RW                  \,5      5      5      r- " S S\.5      r/S r0S r1S  r2S! r3S" r4S# r5S$ r6S% r7S& r8S' r9S( r:S) r;S* r<S+ r=S, r>S- r?S. r@S/ rAS0 rBS1 rCS2 rDS3 rES4 rFS5 rGS6 rHg! \$\%\&4 a    \'" S5        \(" 5          Nf = f)7zn

.. moduleauthor:: easygui developers and Stephen Raymond Ferg
.. default-domain:: py
.. highlight:: python

    N   )utils)	buttonbox)textbox)
diropenbox)fileopenbox)filesavebox)multenterbox)multpasswordbox)ynbox)ccbox)boolbox)indexbox)msgbox)
integerbox)enterboxexceptionbox)codebox)passwordbox)	choicebox)multchoicebox)about)
eg_version)abouteasyguiz+Please run demo.py from outside the packagec                   6    \ rS rSrSrS rS rS rS rS r	Sr
g	)
Demos3   zCollection of demos

A choice is comprised of two pieces of data:
- a description, which is a string. The descriptions will be shown
  in the choicebox, and one will be returned by it.
- a function to execute when the description is selected
c                 b   S[         4S[        4S[        4S[        4S[        4S[
        4S[        4S[        4S	[        4S
[        4S[        4S[        4S[        4S[        4S[        4S[        4S[         4S["        4S[$        4S[&        4S[(        4S[*        4S[,        4S[.        4/U l        g )Nr   r   r   r   r   z buttonbox that displays an imagezbuttonbox - select an imager   r   r   r   r   r   r   r   r
   r   zenterbox that displays an imager	   r   r   r   zAbout EasyGuiHelp)demo_msgbox
demo_ynbox
demo_ccboxdemo_boolboxdemo_buttonboxdemo_buttonbox_with_imagedemo_buttonbox_with_choicedemo_indexboxdemo_choiceboxdemo_multichoiceboxdemo_textboxdemo_codeboxdemo_enterboxdemo_integerboxdemo_passwordboxdemo_multenterboxdemo_multpasswordboxdemo_enterbox_imagedemo_filesaveboxdemo_fileopenboxdemo_diropenboxdemo_exceptionbox
demo_about	demo_helpdemosselfs    l/var/www/eduai.edurigo.com/question_generate/ques_gen_env/lib/python3.13/site-packages/easygui/boxes/demo.py__init__Demos.__init__=   s    {#j!j!%.)/1JK*,FG'.)12%%'?+,-./ 45.0CD,-,-?+./j)Y1

    c                 L    U R                    Vs/ s H  oS   PM	     nnU$ s  snf Nr   r9   )r;   cdescriptionss      r<   list_descriptionsDemos.list_descriptionsY   s'    &*jj1j!j1 2s   !c                 *    U R                   U   nUS   $ )Nr   rB   r;   indexdemos      r<   get_demoDemos.get_demo]   s    zz% Awr?   c                 *    U R                   U   nUS   $ rA   rB   rH   s      r<   get_descriptionDemos.get_descriptionb   s    zz% Awr?   c                 ,    [        U R                  5      $ )N)lenr9   r:   s    r<   __len__Demos.__len__f   s    4::r?   rB   N)__name__
__module____qualname____firstlineno____doc__r=   rE   rK   rN   rR   __static_attributes__ r?   r<   r   r   3   s     
8
r?   r   c                     [        5       n S/[        U 5      -  n[        S5        / nUR                  S5        UR                  SR	                  [
        R                  5      5        UR                  SR	                  [        5      5        UR                  SR	                  [        R                  5      5        SR                  U5      nS[        -   nU R                  5       nS	n [        XQ5       VVs/ s H	  u  pxXx-   PM     n	nn[        UUU	US
9n
U
(       d  g[        U
5        U	R                  U
5      nU R                  U5      nU" 5       nU(       a  SR	                  U5      X'   OSX'   US-  nU[        U	5      :  a  S	nM  s  snnf )z
Run the EasyGui demo.
 zd



































































































z+Pick the kind of box that you wish to demo.z * Python version {}z * EasyGui version {}z * Tk version {}
zEasyGui r   )msgtitlechoices	preselectz - Last reply: {}r   N)r   rQ   printappendformatsysversionr   ut	TkVersionjoinrE   zipr   rI   rK   )r9   repliesr^   intro_messager_   rD   preselecteddrpresented_choicesreplyindex_chosen_demochosen_demo
demo_replys                 r<   easygui_demoru   j   sl    GEdSZG	*
CJJ<=JJ%,,S[[9:JJ&--j9:JJ!((67IIcNM#E**,LK
!,8:8daAE8 	 :m %"3$/
 e-33E: nn%67 ]
 )<)C)CJ)OG&)+G&q#/00K7 :s   3Fc                  R    [        SS5      n [        SR                  U 5      5        U $ )Nz	short msgzThis is a long titleReply was: {!r})r   rb   rd   rq   s    r<   r!   r!      s(    ; 67E	

"
"5
)*Lr?   c                      [        / SQSS9n [        SR                  U 5      5        SnSn[        X!/ SQSS	9n [        SR                  U 5      5        U $ )
N)onetwor{   threer{   )r`   default_choicerw   z*Demo of Buttonbox with many, many buttons!zDThis buttonbox shows what happens when you specify too many buttons.)1234567r   )r^   r_   r`   cancel_choice)r   rb   rd   )rq   r_   r^   s      r<   r%   r%      s_    <%*,E	

"
"5
)*8E'C#A$')E 


"
"5
)*Lr?   c                     Sn / SQn[         R                  R                  [        S5      [         R                  R                  [        S5      [         R                  R                  [        S5      [         R                  R                  [        S5      4 H)  n[	        X-   X!S9n[        SR                  U5      5        M+     W$ )	Nz Do you like this picture?
It is )YesNoz
No opinionpython_and_check_logo.gifpython_and_check_logo.jpgpython_and_check_logo.png	zzzzz.gif)imager`   rw   )ospathri   package_dirr   rb   rd   )r^   r`   r   rq   s       r<   r&   r&      s    
-C)G GGLL&ABGGLL&ABGGLL&ABGGLLk2	4
 #+UD&&u-.4 Lr?   c                     Sn S/n[        5       nUR                  [        R                  R	                  [
        S5      5        UR                  [        R                  R	                  [
        S5      5        UR                  [        R                  R	                  [
        S5      5        UR                  [        R                  R	                  [
        S5      5        [        XS/S9n[        SR                  U5      5        U$ )	NzPick an imagecancelr   r   r   r   )imagesr`   rw   )	listrc   r   r   ri   r   r   rb   rd   )r^   r`   r   rq   s       r<   r'   r'      s    
CjGVF
MM"'',,{,GHI
MM"'',,{,GHI
MM"'',,{,GHI
MM"'',,{K89c8*=E	

"
"5
)*Lr?   c                  X    Sn Sn[        X5      n[        SR                  U5      5        U$ )Nz!Insert your favorite message herezDemo of ccboxrw   )r   rb   rd   )r^   r_   rq   s      r<   r#   r#      s/    
-CE#E	

"
"5
)*Lr?   c                  d    / SQn S nSn[        USX5      n[        SR                  U5      5        U$ )N)aaabbbcccggghhhiiijjjkkkLLLmmmnnnooopppqqqrrrssstttuuuvvvz!Pick as many choices as you wish.zDemo of multchoiceboxrw   )r   rb   rd   )listChoicesra   r^   rq   s       r<   r*   r*      s=    K I
-C#6OE	

"
"5
)*Lr?   c                  ~    Sn Sn[        X5      n[        SR                  U5      5        U(       a  [        SS5        U$ )NzDemo of ynboxz+Were you expecting the Spanish Inquisition?rw   z'NOBODY expects the Spanish Inquisition!zWrong!)r   rb   rd   r   )r_   r^   rq   s      r<   r"   r"      s=    E
7C#E	

"
"5
)*8(CLr?   c                  6   Sn SnSSSSSUSSS	S
SSSSSSSSSSSSSSS/nSn[        X2S9n[        SR                  U5      5        Sn[        X0US9n[        SR                  U5      5        Sn[        S[        5       S9n[        SR                  U5      5        U$ )NzDemo of choiceboxzThis is an example of a very long option which you may or may not wish to choose.This is an example of a very long option which you may or may not wish to choose.r   dddeeefffr   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   aH  Pick something. A wrapable sentence of text ?! A wrapable sentence of text ?! A wrapable sentence of text ?! A wrapable sentence of text ?! A wrapable sentence of text ?! A wrapable sentence of text ?! A wrapable sentence of text ?! A wrapable sentence of text ?! A wrapable sentence of text ?! A wrapable sentence of text ?! A wrapable sentence of text ?! A wrapable sentence of text ?! A wrapable sentence of text ?! A wrapable sentence of text ?! A wrapable sentence of text ?! A wrapable sentence of text ?! A wrapable sentence of text ?! A wrapable sentence of text ?! A wrapable sentence of text ?! A wrapable sentence of text ?! A wrapable sentence of text ?! A wrapable sentence of text ?! A wrapable sentence of text ?! A wrapable sentence of text ?! A wrapable sentence of text ?! A wrapable sentence of text ?! A wrapable sentence of text ?! A wrapable sentence of text ?! A wrapable sentence of text ?! A wrapable sentence of text ?! 
A separate line of text.
A separate line of text.
A separate line of text.
A separate line of text.
A separate line of text.
A separate line of text.)r^   r`   rw   zPick something. )r^   r_   r`   zThe list of choices is empty!)r   rb   rd   r   )r_   
longchoicer   r^   rq   s        r<   r)   r)      s    E	  %uueUE5%ue%%u	6K,C #3E	

"
"5
)*
C#K@E	

"
"5
)*
C+TV=E	

"
"5
)*Lr?   c                      [        SSSSS5      n [        SR                  U 5      5        [        SS5      n [        SR                  U 5      5        U $ )	Nz Enter a number between 3 and 333z%Demo: integerbox WITH a default value      iM  rw   zEnter a number between 0 and 99z(Demo: integerbox WITHOUT a default value)r   rb   rd   rx   s    r<   r.   r.     sY    */a>E 


"
"5
)*)2E 


"
"5
)*Lr?   c                  N    [        5       n [        SR                  U 5      5        U $ Nrw   )r   rb   rd   rx   s    r<   r7   r7     s"    NE	

"
"5
)*Lr?   c                  <   [         R                  R                  [        S5      n Sn[	        USS5      n[        SR                  U5      5        Sn[	        USSSS9n[        SR                  U5      5        [	        S	S
5      n[        SR                  U5      5        U$ )Nr   z>Enter the name of your best friend.
(Result will be stripped.)zLove!z     Suzy Smith     rw   zBEnter the name of your best friend.
(Result will NOT be stripped.)F)stripz#Enter the name of your worst enemy:zHate!r   r   ri   r   r   rb   rd   r   messagerq   s      r<   r-   r-     s    GGLL&ABE.GWg'=>E	

"
"5
)*2G0?E	

"
"5
)*:GDE	

"
"5
)*Lr?   c                     Sn Sn/ SQn[        5       n[        XU5      n Uc  O[        5       n[        X#5       H;  u  pVUR                  5       S:X  d  M  UR	                  SR                  U5      5        M=     [        U5      (       d  O[        SR                  U5      XU5      nM  [        SR                  U5      5        U$ )NzEnter logon informationzDemo of multpasswordbox)z	Server IDzUser IDPasswordr\   z"{}" is a required field.

Reply was: {!s})	r   r   rj   r   rc   rd   rQ   ri   rb   r^   r_   
fieldNamesfieldValueserrsnvs          r<   r1   r1   +  s    
#C%E5J&K!#j9K v
0DAwwyB;BB1EF 1 4yy%GGDM5k;  


"
";
/0r?   c                  d    SS-  n SnSn[        X!U 5      n[        SR                  U5      5        U$ )Na  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! 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! 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! 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! 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! 


   zDemo of textboxa  Here is some sample text. Here is some sample text. Here is some sample text. Here is some sample text. Here is some sample text. Here is some sample text. Here is some sample text. Here is some sample text. Here is some sample text. Here is some sample text. Here is some sample text. Here is some sample text. Here is some sample text. Here is some sample text. Here is some sample text. Here is some sample text. r   )r   rb   rd   )text_snippetr_   r^   rq   s       r<   r+   r+   C  sD    
 L E
+CC-E	

"
"5
)*Lr?   c                  \    Sn Sn[        USU 5      n[        SR                  U5      5        U$ )Na}  dafsdfa dasflkj pp[oadsij asdfp;ij asdfpjkop asdfpok asdfpok asdfpokdafsdfa dasflkj pp[oadsij asdfp;ij asdfpjkop asdfpok asdfpok asdfpokdafsdfa dasflkj pp[oadsij asdfp;ij asdfpjkop asdfpok asdfpok asdfpok
# here is some dummy Python code
for someItem in myListOfStuff:
    do something(someItem)
    do something()
    do something()
    if somethingElse(someItem):
        doSomethingEvenMoreInteresting()

# here is some dummy Python code
for someItem in myListOfStuff:
    do something(someItem)
    do something()
    do something()
    if somethingElse(someItem):
        doSomethingEvenMoreInteresting()

# here is some dummy Python code
for someItem in myListOfStuff:
    do something(someItem)
    do something()
    do something()
    if somethingElse(someItem):
        doSomethingEvenMoreInteresting()

# here is some dummy Python code
for someItem in myListOfStuff:
    do something(someItem)
    do something()
    do something()
    if somethingElse(someItem):
        doSomethingEvenMoreInteresting()

# here is some dummy Python code
for someItem in myListOfStuff:
    do something(someItem)
    do something()
    do something()
    if somethingElse(someItem):
        doSomethingEvenMoreInteresting()

# here is some dummy Python code
for someItem in myListOfStuff:
    do something(someItem)
    do something()
    do something()
    if somethingElse(someItem):
        doSomethingEvenMoreInteresting()

# here is some dummy Python code
for someItem in myListOfStuff:
    do something(someItem)
    do something()
    do something()
    if somethingElse(someItem):
        doSomethingEvenMoreInteresting()

# here is some dummy Python code
for someItem in myListOfStuff:
    do something(someItem)
    do something()
    do something()
    if somethingElse(someItem):
        doSomethingEvenMoreInteresting()

# here is some dummy Python code
for someItem in myListOfStuff:
    do something(someItem)
    do something()
    do something()
    if somethingElse(someItem):
        doSomethingEvenMoreInteresting()

# here is some dummy Python code
for someItem in myListOfStuff:
    do something(someItem)
    do something()
    do something()
    if somethingElse(someItem):
        doSomethingEvenMoreInteresting()

# here is some dummy Python code
for someItem in myListOfStuff:
    do something(someItem)
    do something()
    do something()
    if somethingElse(someItem):
        doSomethingEvenMoreInteresting()

# here is some dummy Python code
for someItem in myListOfStuff:
    do something(someItem)
    do something()
    do something()
    if somethingElse(someItem):
        doSomethingEvenMoreInteresting()

# here is some dummy Python code
for someItem in myListOfStuff:
    do something(someItem)
    do something()
    do something()
    if somethingElse(someItem):
        doSomethingEvenMoreInteresting()

# here is some dummy Python code
for someItem in myListOfStuff:
    do something(someItem)
    do something()
    do something()
    if somethingElse(someItem):
        doSomethingEvenMoreInteresting()

# here is some dummy Python code
for someItem in myListOfStuff:
    do something(someItem)
    do something()
    do something()
    if somethingElse(someItem):
        doSomethingEvenMoreInteresting()

# here is some dummy Python code
for someItem in myListOfStuff:
    do something(someItem)
    do something()
    do something()
    if somethingElse(someItem):
        doSomethingEvenMoreInteresting()

a  Here is some sample code. Here is some sample code. Here is some sample code. Here is some sample code. Here is some sample code. Here is some sample code. Here is some sample code. Here is some sample code. Here is some sample code. Here is some sample code. Here is some sample code. Here is some sample code. Here is some sample code. Here is some sample code. Here is some sample code. Here is some sample code. zCode Samplerw   )r   rb   rd   )code_snippetr^   rq   s      r<   r,   r,   Q  s7    	L ,CC5E	

"
"5
)*Lr?   c                  N    [        5       n [        SR                  U 5      5        U $ r   )r   rb   rd   rx   s    r<   r$   r$   b  s"    IE	

"
"5
)*Lr?   c                      [         R                  R                  [        S5      n Sn[	        USU S9n[        SR                  U5      5        U$ )Nr   zWhat kind of snake is this?Quiz)r   rw   r   r   s      r<   r2   r2   h  sC    GGLL&ABE+GWfE2E	

"
"5
)*Lr?   c                      [        SS5      n [        SR                  U 5      5        [        SSS5      n [        SR                  U 5      5        U $ )Nz@Demo of password box WITHOUT default

Enter your secret passwordzMember Logonr   z=Demo of password box WITH default

Enter your secret passwordalfie)r   rb   rd   rx   s    r<   r/   r/   p  sY     ;&(E 


"
"5
)* ;&1E 


"
"5
)*Lr?   c                  4    [        S[        R                  S9  g )NzEasyGui Help)text)r   r   EASYGUI_ABOUT_INFORMATIONrZ   r?   r<   r8   r8   }  s    N!@!@Ar?   c                  Z    Sn SnSn[        X!U S9n[        SR                  U5      5        U$ )NzmyNewFile.txtzFile SaveAszSave file as:defaultzYou chose to save file: {})r	   rb   rd   )filenamer_   r^   fs       r<   r3   r3     s6    HE
CC1A	
&
-
-a
01Hr?   c                      Sn Sn[        X5      n[        SR                  U5      5        [        XSS9n[        SR                  U5      5        [        XSS9n[        SR                  U5      5        U$ )NzDemo of diropenboxz)Pick the directory that you wish to open.zYou chose directory...: {}z./r   zc:/)r   rb   rd   )r_   r^   rn   s      r<   r5   r5     so     E
5C3A	
&
-
-a
013t,A	
&
-
-a
013u-A	
&
-
-a
01Hr?   c                  2     SS-  n g !   [        5          g = f)Nr   r   r   )#thisWillCauseADivideByZeroExceptions    r<   r6   r6     s%    ./!e+ s    c                  b    Sn Sn/ SQn[        XU5      n[        SR                  U5      5        U$ )NIndexboxzDemo of indexbox)Choice1Choice2Choice3Choice4rw   )r   rb   rd   )r_   r^   r`   rq   s       r<   r(   r(     s6    E
!C:GS)E	

"
"5
)*Lr?   c                     Sn Sn/ SQn[        5       n[        XU5      n Uc  O[        5       n[        X#5       H;  u  pVUR                  5       S:X  d  M  UR	                  SR                  U5      5        M=     [        U5      (       d  O[        SR                  U5      XU5      nM  [        SR                  U5      5        U$ )NzEnter your personal informationzCredit Card Application)NamezStreet AddressCityStateZipCoder\   z"{}" is a required field.r]   zReply was: {})	r   r
   rj   r   rc   rd   rQ   ri   rb   r   s          r<   r0   r0     s    
+C%EGJ&Ks:6K v
0DAwwyB7>>qAB 1 4yy"IIdOU=  
/
 
 
-.r?   c                      Sn SnSn[        XUS9n[        SR                  U5      5        SnSn S/ S	Q/ S
Q/n[        XX$SS9n[        SU-  5        U$ )NzPython filesz
Open filesz*.pyr   zYou chose to open file: {}z./*.gifz$Some other file types (Multi-select)z*.jpg)z*.zipz*.tgsz*.gzzArchive files)z*.htmz*.htmlz
HTML filesT)r   	filetypesmultiplezYou chose to open file: %s)r   rb   rd   )r^   r_   r   r   r   s        r<   r4   r4     ss    
CEGC0A	
&
-
-a
01G
0C ,-NPIG4	IA	
&
*+Hr?   )IrX   r   re   r\   r   rg   
button_boxr   text_boxr   diropen_boxr   fileopen_boxr   filesave_boxr	   multi_fillable_boxr
   r   derived_boxesr   r   r   r   r   r   r   r   r   r   
choice_boxr   r   r   r   r   SystemError
ValueErrorImportErrorrb   exitr   dirnamerealpath__file__r   objectr   ru   r!   r%   r&   r'   r#   r*   r"   r)   r.   r7   r-   r1   r+   r,   r$   r2   r/   r8   r3   r5   r6   r(   r0   r4   rZ   r?   r<   <module>r      s>   
 
%!'))03$$&'%)'+&*%)!# ggoobggoobgg.>.>x.HIJ4F 4n.b
	:$0"

0y 	Z- 	
78Fs   B
D: :EE