The tkinter .get metho d is not working properly : <p>I am trying to make a formula calculator for a school project. I am trying to use the .get tkinter method to get what is in an Entry. It always sends an error. I don't want to write it into a class though.</p>

<p>This is not the final code.</p>

<pre><code>from tkinter import *

def speedCalc():
    _distance = spDistance.get()
    _time = spTime.get()

spDistance = Entry(speed).grid(row=1, column=1)
spTime = Entry(speed).grid(row=2, column=1)
spSpeed = Entry(speed).grid(row=3, column=1)

spConvert = Button(speed, text="Calculate", command=speedCalc)
spConvert.grid(row=4, column=1)
</code></pre>

<p>When I execute the code, it says this on the console:</p>

<pre><code>Exception in Tkinter callback
Traceback (most recent call last):
  File"C:\Users\JackP\AppData\Local\Programs\Python\Python36\lib\tkinter\__init__.py", line 1699, in __call__
return self.func(*args)
  File "C:/Users/JackP/Desktop/Python Projets/Formula App/4. Extention.py", line 25, in speedCalc
_distance = spDistance.get()
AttributeError: 'NoneType' object has no attribute 'get'
</code></pre>
