user4316433
user4316433

Reputation:

TypeError: must be str or None, not Frame

Using an OOP approach to developing a tkinter program for the first time based on the sentdex tkinter series. I honestly have no idea what the error here means.

The error directs me to:

  File "C:\Users\Ash\Dropbox\Programming\Python\WorldManager PY\WorldManager.py", line 59, in __init__
tk.Tk.__init__(self, *args, **kwargs)
File "C:\Python34\lib\tkinter\__init__.py", line 1867, in __init__
self.tk = _tkinter.create(screenName, baseName, className, interactive, wantobjects, useTk, sync, use)
TypeError: must be str or None, not Frame

The code I've used is here

EDIT: While the code says the line is 59, the error is on line 46. I took out a few comments from above the code when I pastebinned it.

Upvotes: 1

Views: 2706

Answers (1)

Bryan Oakley
Bryan Oakley

Reputation: 385890

The problem is here:

class frmWelcome(tk.Frame):
    def __init__(self, *args, **kwargs):
        #initialise tkinter
        tk.Tk.__init__(self, *args, **kwargs)

You are inheriting from tk.Frame yet you are calling tk.Tk.__init__ You need to be calling tk.Frame.__init__

Upvotes: 2

Related Questions