-2

I tried changing the object types of the function variables, I tried many things from making them global to making a new function but still it shows the same error while executing the program!!

Pls debug the code anyone!!

Here's the full code: "https://pastebin.com/DE00hAnt"

  • Where did you get the idea of `variable = Widget(...).grid(...)`? A lot of people make that mistake but I don't know what tutorial is causing this issue. – TheLizzard Mar 03 '21 at 18:05

1 Answers1

0

You know when you did this:

w = Entry(P_d, width=25, borderwidth=5).grid(row=0, column=1, pady=20)

Python interpreted it as:

temp = Entry(P_d, width=25, borderwidth=5)
w = temp.grid(row=0, column=1, pady=20)

So you are storing the result of the .grid method (which is aways None) in w instead of the actual Entry widget. Change it to this:

w = Entry(P_d, width=25, borderwidth=5)
w.grid(row=0, column=1, pady=20)

Btw your code has a lot of those mistakes. Always split widget creating/widget placement on 2 lines.

TheLizzard
  • 7,248
  • 2
  • 11
  • 31