79613309

Date: 2025-05-08 23:45:04
Score: 5.5
Natty:
Report link

It's 9 years later and I'm disappointed the "Accepted Answer" on this is completely wrong. I also can't downvote or comment on anything because of the broken reputation system on here too. The issue with

tennis_window.title('Top Ten Tennis')

Has nothing to do with the error OP is asking about as I'm getting the exact same error without ever trying to set the Title or a string anywhere. Something about just creating a new Window with TopLevel is causing a weird error where python keeps thinking it is a string object for whatever reason. I'm currently unable to just call something as basic as:

NewWindow = TopLevel()

without getting this exact same error where it says 'str' obj is not callable. I've even used type hinting to explicitly say the type but it always seems to think it is a 'str' obj for whatever reason. It'd be awesome if someone had the real answer for this.

For reference here is the entirety of the code I'm using to get this exact same type error:

def CreateNewWindow():
    NewWindow = Toplevel()

That's literally it. I then just call the function from a ttk.Button with command=CreateNewWindow()

Reasons:
  • RegEx Blacklisted phrase (1.5): reputation
  • RegEx Blacklisted phrase (2): downvote
  • Long answer (-1):
  • Has code block (-0.5):
  • Me too answer (2.5): I'm getting the exact same error
  • Low reputation (1):
Posted by: Tommy Wilkinson