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 8292913
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T13:38:46+00:00 2026-06-08T13:38:46+00:00

I am just learning MVC and im using Tkinter to do so, but while

  • 0

I am just learning MVC and im using Tkinter to do so, but while i am trying to configure a button from a class within a class i keep getting this error

Traceback (most recent call last):
  File "Controller.py", line 22, in <module>
    controller = Controller(root)
  File "Controller.py", line 10, in __init__
    self.view.addWidgets.btn.config(command=self.addShow)
  File "/usr/lib/python2.7/lib-tk/Tkinter.py", line 1205, in configure
    return self._configure('configure', cnf, kw)
  File "/usr/lib/python2.7/lib-tk/Tkinter.py", line 1196, in _configure
    self.tk.call(_flatten((self._w, cmd)) + self._options(cnf))
_tkinter.TclError: invalid command name ".35986680.35987112.35991848"

If you cant determine the problem from the error i can post my code, but they are in two separate files, although the files are only 40 lines long.

Details:

Button is in Frame class
Frame class is in View class
View class is in Controller class
function being called by Button command is in Controller class
    error happens when i configure button from Controller class
    self.view.addWidgets.btn.config(command=self.addShow)

Edit

I striped the code.

Controller.py

from View import *
from Model import *
from Tkinter import *

class Controller:
    def __init__(self,root):
        self.model = Model()
        self.view = View(root)

        self.view.addWidgets.btn.config(command=self.addShow)

    def addShow(self):
        print 'Working'


root=Tk()
root.withdraw()
controller = Controller(root)
root.mainloop()

View.py

from Tkinter import *
from MultiListbox import *
from AddFrame import *  

class View(Toplevel):
    def __init__(self, master):
        Toplevel.__init__(self, master)
        self.title('Show Preserver')

        self.protocol(self.protocol('WM_DELETE_WINDOW', master.destroy))#When i delete this i dont get the error but it still dosent work

        self.addFrame=Frame(self,bg='black')
        self.addWidgets=AddFrame(self.addFrame)

        self.addFrame.grid(row=0)

        self.mainloop()

AddFrame.py

#Add Frame
from Tkinter import *

class AddFrame(Frame):

    def __init__(self,master):

        self.frame = Frame(master,bg='black')
        self.frame.grid(row=0,column=0,sticky=W+E)

        self.btn = Button(self.frame,text='Add',bg='black',fg='yellow',activebackground='yellow',activeforeground='black', width=2,command=None)     
        self.btn.grid(row=0,column=6,sticky=E)
  • 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-06-08T13:38:47+00:00Added an answer on June 8, 2026 at 1:38 pm

    The error invalid command name ".35986680.35987112.35991848" comes from the underlying Tcl interpreter which powers Tkinter. .35986680.35987112.35991848 is the low-level identifier for the widget, and it also represents a proxy command which is used to interact with that widget. Since Tcl is saying “invalid command name”, that almost always means that the low level widget has been destroyed since the command goes away when the widget is destroyed.

    Looking at your code, it appears that .35986680.35987112.35991848 represents self.view.AddWidgets.btn. Are you certain that widget still exists at the time you try to configure it?

    [time passes, and now the question has some code…]

    You are calling mainloop twice, which is not how Tkinter is designed to be used. You need to remove one of those.

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

Sidebar

Related Questions

Just I am learning MVC,(ofcourse i get enough information from MS Website).I want to
Just I started learning MVC pattern, of course i am learning it from Microsoft's
I have a simple ASP.NET MVC 3 dummy app (just learning MVC coming from
I’m just learning ASP.NET MVC and I’m trying to create a mock form request
I'm trying to convert an older ASP.NET application to MVC (I am just learning
I'm just learning C# and MVC, and trying to understand some examples. @Html.EditorFor(m =>
I'm just learning asp.net mvc and I'm trying to figure out how to move
Im just learning mod_rewrite and regex stuff, and what I'm trying to do is
I just started using CakePHP and it's very different from just normal procedural or
i'm just learning to put in unit testing for my asp.net mvc when i

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.