0

I'm getting a problem with Tkinter for python, I have a class, application(root): root is Tk(), and when I run the class without an __init__ function, it works okay, but crashes after I quit the program. With the __init__, Tkinter tells me

Traceback (most recent call last):
  File "C:\stuff\Portable Python 3.2.0.1\application.pyw", line 75, in <module>
    class application(root):
  File "C:\Python32\lib\tkinter\__init__.py", line 1674, in __init__
    self.tk = _tkinter.create(screenName, baseName, className, interactive, wantobjects, useTk, sync, use)
TypeError: must be str, not tuple

Which doesn't make sense to me, I never gave it a tuple. I'm sorry if this is a very idiot question, I tried googling it and came up with nothing. Thanks.

1
  • Did you make absolutely sure nothing you passed it is a tuple by doing print screenName, baseName, className, interactive, wantobjects, useTk, sync, use on the line before? Commented Jul 28, 2011 at 23:13

1 Answer 1

1

root is the base class for application. You have provided an instance of Tk as the base class, rather than the class itself, ie application(Tk).

It would help if you could show a simple example of your failing code.

Sign up to request clarification or add additional context in comments.

1 Comment

Turns out I didn't even need root or Tk in the base class at all anyway, just a blunder on my part. Thank you!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.