Question : python missing 1 required positional argument:
Answered by : carlos-santos-pinto
"""
This might pop up if you're trying to use a class directly,
rather than instantiating it. The "missing" argument is "self"
corresponding to the object that you didn't instantiate
"""
class MyClass: def __init__(self, attr) -> None: self.attr = attr def get_attr (self): return self.attr
# CORRECT
object_of_myclass = MyClass(1)
print (type(object_of_myclass)) # <class '__main__.MyClass'>
print (object_of_myclass.get_attr()) # 1
# INCORRECT
myclass = MyClass
print (type(myclass)) # <class 'type'>
print (myclass.get_attr())
# TypeError: get_attr() missing 1 required positional argument: 'self'
Source : | Last Update : Wed, 09 Jun 21
Question : TypeError: get() missing 1 required positional argument: 'index1' python tkinter
Answered by : adrian-folie
dialog = textbox1.get("1.0",'end-1c')
subject = textbox2.get("1.0",'end-1c')
Source : https://stackoverflow.com/questions/63525858/typeerror-get-missing-1-required-positional-argument-index1 | Last Update : Sat, 18 Jun 22