Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6056639
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T08:23:58+00:00 2026-05-23T08:23:58+00:00

I wrote a simple program importing Tkinter just to play with Radio Buttons. I

  • 0

I wrote a simple program importing Tkinter just to play with Radio Buttons. I find that I’m getting errors in very, very weird places.

 from Tkinter import *

class Application (Frame):
    def __init__(self, master):
        Frame.__init__(self, master)
        self.grid()
        self.create_widgets()

    def create_widgets(self):


        Label(self, text = "Select the last book you read.").grid (row = 0, column = 0, sticky = W)

        self.choice = StringVar() 

        Radiobutton (self,text = "Nausea by Jean-Paul Sartre",variable = self.choice,
                 value = "Wake up. This is a dream. This is all only a test of the emergency broadcasting system.",
                 command = self.update_text).grid (row = 2, column = 1, sticky = W)

        Radiobutton (self,
                 text = "Infinite Jest by David Foster Wallace",
                 variable = self.choice,
                 value = "Because an adult borne without the volition to choose the thoughts that he thinks, is going to get hosed ;)",
                 command = self.update_text).grid (row = 3, column = 1, sticky = W)

        Radiobutton (self,
                 text = "Cat's Cradle by Kurt Vonnegut",
                 variable = self.choice,
                 value = " \"Here we are, trapped in the amber of the moment. There is no why!\" ",
                 command = self.update_text.grid (row = 4, column = 1, sticky = W)

        self.txt_display = Text (self, width = 40, height = 5, wrap = WORD)
        self.txt_display.grid (row = 6, column = 0, sticky = W)


    #There is only one choice value - self.choice. That can be "printed."

    def update_text(self):
        message = self.choice.get()
        self.txt_display.delete (0.0, END)
        self.txt_display.insert (0.0, message)

# The Main
root = Tk()
root.title ("The Book Critic One")
root.geometry ("400x400")

app = Application (root)
root.mainloop()

I seem to be getting errors in very odd places. One came in the “=” sign in the Label attribution and when I changed it to == when i was playing around, the next one came in the variable part of the RadioButton attributes.

Any help would be greatly appreciated. Won’t be able to respond immediately as I have to leave to work in a bit, but if you do spot where the bugs are, please let me know.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T08:23:58+00:00Added an answer on May 23, 2026 at 8:23 am

    There are a lot of things going on here. I’ll just point out the few that I’ve found quickly looking at this.

    For your Label you shouldn’t have = before your parameters…

    Label = (self, text = "Select the last book you read.").grid (row = 0, column = 0, sticky = W)
    

    to:

    Label(self, text = "Select the last book you read.").grid (row = 0, column = 0, sticky = W)
    

    Change all instances of RadioButton to Radiobutton as that is the actual name of the class in Tkinter.

    choice1, choice2, and choice3 do not exist in Application.

    More Stuff:

    def create_widgets() is missing the self parameter: def create_widgets(self)

    Your update_text() function isn’t working because you’re referencing self.text_display, I believe you want this to be self.txt_display since that is how you defined it previously.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I recently wrote a program that used a simple producer/consumer pattern. It initially had
I just wrote a simple C++ program in Visual Studio 2010 and I use
I wrote a simple program that using Class::ArrayObjects but It did not work as
The problem is this: I wrote a simple program that uses FFMPEG. compile as
I wrote a simple program that accesses a file called input.txt and pushes its
I have been looking at Reflection.Emit recently. I wrote a simple program that generates
I wrote a simple program that sorts in O(n). It is highly memory inefficient,
I wrote a simple program that adds two edit fields to the field manager:
I wrote a simple program that will push to another screen whenever a field
I wrote a simple program in that retrieves google home page. the code is

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.