I was creating a Sudoku Game in python with Tk.
I got a error about the function on a keypress for a button
from random import randint
from tkinter i
I'm not a tkinter expert, but it seems (by what I've read so far) that the method
bind(some_string, some_function)
calls function passing the parameter string to it.
You have declared the method kk like
def kk(self):
and it means that it is only expecting one argument. You are also passing the method self.kk to bind(), which means that it will be called like
self.kk('')
There is the problem! That call, in fact, is passing two arguments to the method kk. It's equivalent to
sudoku.kk(janela, '')
Note that janela is the actual instance of the class sudoku. Coming back to the problem, you are passing two arguments!!!
How can you solve it?
As I said I'm not an expert on this topic, but my guess is to declare the method kk with two parameters:
def kk(self, another_parameter):
# ...
Note: I would recommend you to follow Python naming conventions. In other words, class names should be like SomeClassName or Sudoku.