0

CODE:

class CallWrapper:
    """Internal class. Stores function to call when some user
    defined Tcl function is called e.g. after an event occurred."""

    def __init__(self, func, subst, widget):
        """Store FUNC, SUBST and WIDGET as members."""
        self.func = func
        self.subst = subst
        self.widget = widget

    def __call__(self, *args):
        """Apply first function SUBST to arguments, than FUNC."""
        try:
            if self.subst:
                args = self.subst(*args)
            return self.func(*args) 
        except SystemExit:
            raise
        except:
            self.widget._report_exception()

Error:

File "/usr/lib/python3.8/tkinter/__init__.py", line 1892, in __call__
    return self.func(*args)
Luke Woodward
  • 63,336
  • 16
  • 89
  • 104
Python
  • 1
  • 3
    Please edit your question to include the full error message, you've only included one line of the traceback. Please also edit the question to include **your code**: instead it seems you have decided to post some code within `tkinter`. It's unlikely that the problem is there, it's more likely you're using `tkinter` incorrectly. – Luke Woodward Jan 09 '22 at 16:32
  • TypeError: SelectionDuCurseur() takes 0 positional arguments but 1 was given Exception in Tkinter callback Traceback (most recent call last): File "/usr/lib/python3.8/tkinter/__init__.py", line 1892, in __call__ return self.func(*args) TypeError: SelectionDuCurseur() takes 0 positional arguments but 1 was given – Python Jan 09 '22 at 18:13
  • That looks to be a problem with you registering a callback function for handling an event in `tkinter`. It looks like `tkinter` required this callback to take one argument but you gave it a function that didn't take any. Please edit your question to include the definition of your function `SelectionDuCurseur` and also where you pass this function to `tkinter`. Please do this by using the 'Edit' link under the question, rather than by adding comments. – Luke Woodward Jan 09 '22 at 19:21
  • I can have your email please – Python Jan 10 '22 at 16:51
  • Sorry, I'm not prepared to share my email address with you. I've asked you to to edit your question to include extra details that will be necessary for you to be helped any further here. If you would like further help on this site you will need to provide this information. – Luke Woodward Jan 10 '22 at 21:38
  • Please provide enough code so others can better understand or reproduce the problem. – Community Jan 17 '22 at 19:30

0 Answers0