How to solve an issue in a simple TR Tkinter program
<p>Major programming noob here, and my very first question in stackoverflow. I'm trying to make a time reaction tester, with a simplistic Tkinter GUI.</p>

<p>Here's the code</p>

<pre><code>#!/usr/bin/env python 

import tkinter as tk
import time
import random

class TRTest(tk.Frame):
    def __init__(self, master = None):
        super().__init__()
        self.grid()
        self.canv()
        self.createWidgets()
        self.Test                 
        self.totalt = []

    def createWidgets(self):
        self.quitbtn = tk.Button(self, text = "Quit", command=self.master.destroy)
        self.quitbtn.grid(row = 3, column = 3)
        self.label = tk.Label(self, text = "TRTest")
        self.label.grid(row = 1, column = 3)
        self.testbtn = tk.Button(self, text = "Start test", command = self.Test)
        self.testbtn.grid(row = 1, column = 2)

    def canv(self):
        self.scrn = tk.Canvas(self, width = 400, height = 400, bg = "#E8E8E8")
        self.scrn.grid(row = 2, column = 3)

    def fixate(self):
        self.scrn.create_line(190, 200, 210, 200, width = 2)
        self.scrn.create_line(200, 190, 200, 210, width = 2)

    def createCircle(self):
        self.scrn.create_oval(150, 150, 250, 250, fill = "red", tag = "circle")                

    def Test(self):              
        if len(self.totalt) == 0:
            self.fixate()                
            self.update()
            self.bind_all("&lt;Key&gt;", self.gettime)
        self.after(random.randint(1000, 5000))
        self.t0 = time.clock()
        self.createCircle()

    def gettime(self, event):
        t = time.clock() - self.t0
        self.totalt.append(t)
        self.scrn.delete("circle")
        if len(self.totalt) &lt; 6:
            self.Test
        else:
            print(self.totalt)
a = tk.Tk()
b = TRTest(a)
b.mainloop()
</code></pre>

<p>It should be making 5 trials and returning the list of the measured TR times, but it freezes before showing a second circle. Where's the problem?
Thank you!!</p>

<p>I think you are trying to run the method <code>Test</code> with</p>

<pre><code>self.Test
</code></pre>

<p>Try instead </p>

<pre><code>self.Test()
</code></pre>

python python-3.x tkinter