<html>
<head>
<meta http-equiv="Content-Type" content="text/html;
charset=windows-1252">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<p><font face="Helvetica, Arial, sans-serif">Yes, that error message
is confusing if you haven't seen it before --<br>
in python, any bound method implicitly/automagically gets the
"self"<br>
argument, so calling it without arguments already gives it one<br>
argument, "self". In your code, you explicitly added "self", so
that<br>
is considered a second argument. So if the __init__ method for
SitesWindow<br>
has a signature like: def __init__(self): ...<br>
then you can just create a SitesWindow using</font><font
face="Helvetica, Arial, sans-serif"><font face="Helvetica,
Arial, sans-serif"> "SitesWindow()".</font></font></p>
<p><font face="Helvetica, Arial, sans-serif">Steve<br>
</font></p>
<p><font face="Helvetica, Arial, sans-serif">On 4/29/21 11:33 AM,
Rich Shepard wrote:
<blockquote type="cite">I'm trying to add a tab's content to a
QTabWidget but get this error:
<br>
$ python mwe.py Traceback (most recent call last):
<br>
File "mwe.py", line 31, in <module>
<br>
mw = MainWindow()
<br>
File "mwe.py", line 20, in __init__
<br>
self.sw = SitesWindow(self)
<br>
TypeError: __init__() takes 1 positional argument but 2 were
given
<br>
<br>
It's been a long time since I did any serious python coding
and despite my
<br>
researching this error on the Web I still fail to see the
solution. I know
<br>
it's simple but I don't see the two arguments to the
assignment. An minimal
<br>
example is attached.
<br>
<br>
Please point out my error.
<br>
<br>
TIA,
<br>
<br>
Rich
<br>
<br>
</blockquote>
<br>
</font></p>
<p><font face="Helvetica, Arial, sans-serif"></font><br>
</p>
</body>
</html>