Get the entry with Tkinter : <p>Hello I have this code :</p>

<pre><code>import Tkinter as tk

root = tk.Tk()
margin = 0.23
entry = tk.entry(root).grid(row=1,column=1)

def profit_calculator():
    profit = margin*int(entry.get())
    print(profit)

button_calc = tk.Button(root, text="Calculate", command=profit_calculator).grid(row=2,column=1)

root.mainloop()
</code></pre>

<p>I tried to execute this code I put a value in the entry but when I clicked on the button I get this :</p>

<pre><code>AttributeError : 'NoneType' object has no attribute 'get'
</code></pre>

<p>I have to use grid absolutely but I don't know why I get this error...</p>

<p>Can you help me ? </p>

<p>Thank you :)</p>
