开发者

Tkinter Class "must be str not tuple" TypeError Python

开发者 https://www.devze.com 2023-03-23 12:34 出处:网络
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 prog

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 开发者_StackOverflow社区__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.


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消