How come my Tkinter entry boxes are classified as “NoneType”?Does SCO Unix 7.1.4 come with Python...

How to hide some fields of struct in C?

What are some good ways to treat frozen vegetables such that they behave like fresh vegetables when stir frying them?

Can a Canadian Travel to the USA twice, less than 180 days each time?

What if a revenant (monster) gains fire resistance?

Redundant comparison & "if" before assignment

Recommended PCB layout understanding - ADM2572 datasheet

Temporarily disable WLAN internet access for children, but allow it for adults

Is this toilet slogan correct usage of the English language?

Why Shazam when there is already Superman?

What are the advantages of simplicial model categories over non-simplicial ones?

creating a ":KeepCursor" command

What is Cash Advance APR?

Calculate sum of polynomial roots

Why would a new[] expression ever invoke a destructor?

Electoral considerations aside, what are potential benefits, for the US, of policy changes proposed by the tweet recognizing Golan annexation?

Unexpected behavior of the procedure `Area` on the object 'Polygon'

The IT department bottlenecks progress. How should I handle this?

Does Doodling or Improvising on the Piano Have Any Benefits?

Add big quotation marks inside my colorbox

Does an advisor owe his/her student anything? Will an advisor keep a PhD student only out of pity?

Why is so much work done on numerical verification of the Riemann Hypothesis?

Why does the Sun have different day lengths, but not the gas giants?

What should you do when eye contact makes your subordinate uncomfortable?

Using substitution ciphers to generate new alphabets in a novel



How come my Tkinter entry boxes are classified as “NoneType”?


Does SCO Unix 7.1.4 come with Python installed?Do the latest Redhat distros come with SciPy?What Linux distributions come with Python 3 as the default?How are python applications uninstalled in linux?How Are Integers Stored In ExcelHow can I get the entry of some commands in .bash_history through a script in centos?How to install the “google” module for Python in Windows 10?How do I write a .pth file?How to delete lines after : if value is >5 in Notepad++ or PythonHow to make python use latest SQLite













0















I am trying to make a tkinter program that calculates the land transfer tax. When I run this code, it gives me the following error when I try to calculate it:



Exception in Tkinter callback
Traceback (most recent call last):
File "C:UsersAngelaAppDataLocalProgramsPythonPython37- 32libtkinter__init__.py", line 1705, in __call__
return self.func(*args)
File "C:/Users/Angela/PycharmProjects/Editor/Editor.py", line 16, in <lambda>
ok = Button(master, text="Calculate tax", command= lambda: callback(master, entry_box)).grid(row=0, column=2)
File "C:/Users/Angela/PycharmProjects/Editor/Editor.py", line 19, in callback
price = entry_box.get()
AttributeError: 'NoneType' object has no attribute 'get'


Here is the code that I have:



master = Tk()

label = Label(master, text="Price of house: ").grid(row=0)
entry_box = Entry(master).grid(row=0, column=1)

ok = Button(master, text="Calculate tax", command= lambda: callback(master, entry_box)).grid(row=0, column=2)

def callback(master, entry_box):
price = entry_box.get()
price = int(price)
tax_price = 275
if price > 55000:
tax_price += (250000 - 55000) * 0.1
else:
tax_price += 55000 * 0.05
if price > 250000:
tax_price += (368333 - 250000) * 0.15
if price > 368333:
tax_price += (400000 - 368333) * 0.15
if price > 400000:
tax_price += (2000000 - 400000) * 0.2
if price > 2000000:
tax_price += (price - 2000000) * 0.25
show_tax_price = Label(master, text=tax_price).grid(row=0, column=3)



mainloop()


Can someone tell me what is wrong with my program?









share







New contributor




Jerry Cui is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.

























    0















    I am trying to make a tkinter program that calculates the land transfer tax. When I run this code, it gives me the following error when I try to calculate it:



    Exception in Tkinter callback
    Traceback (most recent call last):
    File "C:UsersAngelaAppDataLocalProgramsPythonPython37- 32libtkinter__init__.py", line 1705, in __call__
    return self.func(*args)
    File "C:/Users/Angela/PycharmProjects/Editor/Editor.py", line 16, in <lambda>
    ok = Button(master, text="Calculate tax", command= lambda: callback(master, entry_box)).grid(row=0, column=2)
    File "C:/Users/Angela/PycharmProjects/Editor/Editor.py", line 19, in callback
    price = entry_box.get()
    AttributeError: 'NoneType' object has no attribute 'get'


    Here is the code that I have:



    master = Tk()

    label = Label(master, text="Price of house: ").grid(row=0)
    entry_box = Entry(master).grid(row=0, column=1)

    ok = Button(master, text="Calculate tax", command= lambda: callback(master, entry_box)).grid(row=0, column=2)

    def callback(master, entry_box):
    price = entry_box.get()
    price = int(price)
    tax_price = 275
    if price > 55000:
    tax_price += (250000 - 55000) * 0.1
    else:
    tax_price += 55000 * 0.05
    if price > 250000:
    tax_price += (368333 - 250000) * 0.15
    if price > 368333:
    tax_price += (400000 - 368333) * 0.15
    if price > 400000:
    tax_price += (2000000 - 400000) * 0.2
    if price > 2000000:
    tax_price += (price - 2000000) * 0.25
    show_tax_price = Label(master, text=tax_price).grid(row=0, column=3)



    mainloop()


    Can someone tell me what is wrong with my program?









    share







    New contributor




    Jerry Cui is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
    Check out our Code of Conduct.























      0












      0








      0








      I am trying to make a tkinter program that calculates the land transfer tax. When I run this code, it gives me the following error when I try to calculate it:



      Exception in Tkinter callback
      Traceback (most recent call last):
      File "C:UsersAngelaAppDataLocalProgramsPythonPython37- 32libtkinter__init__.py", line 1705, in __call__
      return self.func(*args)
      File "C:/Users/Angela/PycharmProjects/Editor/Editor.py", line 16, in <lambda>
      ok = Button(master, text="Calculate tax", command= lambda: callback(master, entry_box)).grid(row=0, column=2)
      File "C:/Users/Angela/PycharmProjects/Editor/Editor.py", line 19, in callback
      price = entry_box.get()
      AttributeError: 'NoneType' object has no attribute 'get'


      Here is the code that I have:



      master = Tk()

      label = Label(master, text="Price of house: ").grid(row=0)
      entry_box = Entry(master).grid(row=0, column=1)

      ok = Button(master, text="Calculate tax", command= lambda: callback(master, entry_box)).grid(row=0, column=2)

      def callback(master, entry_box):
      price = entry_box.get()
      price = int(price)
      tax_price = 275
      if price > 55000:
      tax_price += (250000 - 55000) * 0.1
      else:
      tax_price += 55000 * 0.05
      if price > 250000:
      tax_price += (368333 - 250000) * 0.15
      if price > 368333:
      tax_price += (400000 - 368333) * 0.15
      if price > 400000:
      tax_price += (2000000 - 400000) * 0.2
      if price > 2000000:
      tax_price += (price - 2000000) * 0.25
      show_tax_price = Label(master, text=tax_price).grid(row=0, column=3)



      mainloop()


      Can someone tell me what is wrong with my program?









      share







      New contributor




      Jerry Cui is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.












      I am trying to make a tkinter program that calculates the land transfer tax. When I run this code, it gives me the following error when I try to calculate it:



      Exception in Tkinter callback
      Traceback (most recent call last):
      File "C:UsersAngelaAppDataLocalProgramsPythonPython37- 32libtkinter__init__.py", line 1705, in __call__
      return self.func(*args)
      File "C:/Users/Angela/PycharmProjects/Editor/Editor.py", line 16, in <lambda>
      ok = Button(master, text="Calculate tax", command= lambda: callback(master, entry_box)).grid(row=0, column=2)
      File "C:/Users/Angela/PycharmProjects/Editor/Editor.py", line 19, in callback
      price = entry_box.get()
      AttributeError: 'NoneType' object has no attribute 'get'


      Here is the code that I have:



      master = Tk()

      label = Label(master, text="Price of house: ").grid(row=0)
      entry_box = Entry(master).grid(row=0, column=1)

      ok = Button(master, text="Calculate tax", command= lambda: callback(master, entry_box)).grid(row=0, column=2)

      def callback(master, entry_box):
      price = entry_box.get()
      price = int(price)
      tax_price = 275
      if price > 55000:
      tax_price += (250000 - 55000) * 0.1
      else:
      tax_price += 55000 * 0.05
      if price > 250000:
      tax_price += (368333 - 250000) * 0.15
      if price > 368333:
      tax_price += (400000 - 368333) * 0.15
      if price > 400000:
      tax_price += (2000000 - 400000) * 0.2
      if price > 2000000:
      tax_price += (price - 2000000) * 0.25
      show_tax_price = Label(master, text=tax_price).grid(row=0, column=3)



      mainloop()


      Can someone tell me what is wrong with my program?







      python python3





      share







      New contributor




      Jerry Cui is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.










      share







      New contributor




      Jerry Cui is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.








      share



      share






      New contributor




      Jerry Cui is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.









      asked 3 mins ago









      Jerry CuiJerry Cui

      1




      1




      New contributor




      Jerry Cui is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.





      New contributor





      Jerry Cui is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.






      Jerry Cui is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.






















          0






          active

          oldest

          votes











          Your Answer








          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "3"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });






          Jerry Cui is a new contributor. Be nice, and check out our Code of Conduct.










          draft saved

          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f1416524%2fhow-come-my-tkinter-entry-boxes-are-classified-as-nonetype%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          0






          active

          oldest

          votes








          0






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes








          Jerry Cui is a new contributor. Be nice, and check out our Code of Conduct.










          draft saved

          draft discarded


















          Jerry Cui is a new contributor. Be nice, and check out our Code of Conduct.













          Jerry Cui is a new contributor. Be nice, and check out our Code of Conduct.












          Jerry Cui is a new contributor. Be nice, and check out our Code of Conduct.
















          Thanks for contributing an answer to Super User!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f1416524%2fhow-come-my-tkinter-entry-boxes-are-classified-as-nonetype%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          VNC viewer RFB protocol error: bad desktop size 0x0I Cannot Type the Key 'd' (lowercase) in VNC Viewer...

          Tribunal Administrativo e Fiscal de Mirandela Referências Menu de...

          looking for continuous Screen Capture for retroactivly reproducing errors, timeback machineRolling desktop...