[Python-Dev] SoS on Tkinter

Cyril Lombardo cyril.lombardo at wanadoo.fr
Fri Aug 15 22:12:09 EDT 2003


Hello everyone,
First, sorry for my poor english (i am french..)
I try to develop  an program with Tkinter. This program is a attentional
psychological test witch is used for evaluate attention in schizophrenic
patients.
 
Methodology:
3 references images are in top-center of window
in middle of windows, a series of 30 images (3 row of 10 images).
If image on the bottom is identical at the references images, the
patient must click on the mouse.
 
 
I have make all interface code, but I need help for obtain the results
of this task
 
If its possible, I want know the number of good responses (when a
patient click on good image (same at reference image)) and the number of
wrong responses(when patient has click on image who has different of
reference image).
 
I want to know too, the number of bottom which has been analysed by the
patient in 30 sec.
 
I am a newbie in python development, and i think with your help I will
finish this program.
 
Summary Python code:
 
root = Tk()
root.title("jeu de carte")
larg, haut=root.winfo_screenwidth(), root.winfo_screenheight()
root.overrideredirect(1)
root.geometry("%dx%d+0+0" % (larg, haut))
frame1= Frame(root)
frame2= Frame(root)
frame1.grid(row=0, column=0)
frame2.grid(row=1, column=0)
 
#card list
liste_cartes =  ['c:/carte1.gif',
                 'c:/carte2.gif',
                 'c:/carte3.gif',
                 'c:/carte4.gif',
                 'c:/carte5.gif',
                 'c:/carte6.gif',
                 'c:/carte7.gif',
                 'c:/carte8.gif',
                 'c:/carte9.gif',
                 'c:/carte10.gif']
 
#tirage aléatoire de l'image de la carte modèle
temp= liste_cartes
carte_modèle= random.choice(temp)
 
#affichage de l'image de la carte modèle dans le frame1
carte_modèle = PhotoImage (file=carte_modèle)
label1= Label(frame1, image=carte_modèle, borderwidth=5, relief=RIDGE)
label1.grid()
 
 
#Choix aléatoire des images de carte sur les boutons en frame 2
class ImButton(Button):
    def __init__(self,master,liste,**args):
        f=random.choice(liste)
        self.p=PhotoImage(file=f)
 
#Création des Boutons
r=2
while r >= 0:
    c=8
    while c>=0:
        b=ImButton(frame2,liste_cartes)
        b.grid(row=r, column=c, padx= 3, pady= 3, ipadx=5, ipady= 5
    r= r-1
 
 
 
root.mainloop()
 
________________________________________________________________________
__
 
 Thkx a lot for you r help
 
 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.python.org/pipermail/python-dev/attachments/20030815/c7ab6db7/attachment.htm


More information about the Python-Dev mailing list