The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.
|
 |
|
Dev Shed Forums
> Programming Languages
> Python Programming
|
SoS on Tkinter (psychological test)
Discuss SoS on Tkinter (psychological test) in the Python Programming forum on Dev Shed. SoS on Tkinter (psychological test) Python Programming forum discussing coding techniques, tips and tricks, and Zope related information. Python was designed from the ground up to be a completely object-oriented programming language.
|
|
 |
|
|
|
|

Dev Shed Forums Sponsor:
|
|
|

August 17th, 2003, 03:53 AM
|
|
Junior Member
|
|
Join Date: Aug 2003
Posts: 1
Time spent in forums: < 1 sec
Reputation Power: 0
|
|
|
SoS on Tkinter (psychological test)
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
|

August 18th, 2003, 12:18 AM
|
 |
onCsdfeu
|
|
Join Date: Jul 2003
Location: Canada
Posts: 100
Time spent in forums: 2 h 16 m 21 sec
Reputation Power: 10
|
|
Well I don't have much time to look on that, but I did translate the comments for our non-french speaking friends. just in case they're faster than me (and they are  ):
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']
#random drawing of the card model's image
temp= liste_cartes
carte_modèle= random.choice(temp)
#display of image card model in frame1
carte_modèle = PhotoImage (file=carte_modèle)
label1= Label(frame1, image=carte_modèle, borderwidth=5, relief=RIDGE)
label1.grid()
#Random choice of card images for buttons on frame 2
class ImButton(Button):
def __init__(self,master,liste,**args):
f=random.choice(liste)
self.p=PhotoImage(file=f)
#Button creation
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()
|
Developer Shed Advertisers and Affiliates
| Thread Tools |
Search this Thread |
|
|
|
| Display Modes |
Rate This Thread |
Linear Mode
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|
|