P
P
python_noob_80lv2019-12-17 21:54:17
Python
python_noob_80lv, 2019-12-17 21:54:17

Why does the code snippet throw an error?

The code snippet itself:

def uch(self):
        self.uch = MyUch()
        self.uch.show() 

    def och(self):
        self.och = Myoch()
        self.och.show()       
        
    def opr(self):
        try:
            file = open(self.lineEdit1.text() + '.txt')
        except IOError as e:
            och()
        else:
            uch()

Mistake:
Traceback (most recent call last):
  File "C:\for cheacher\sentense.py", line 82, in opr
    uch()
TypeError: uch() missing 1 required positional argument: 'self'

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
antonksa, 2019-12-18
@antonksa

Wow! Oh. Def...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question