'Error using Tk inter, when creating an event

So I have an assessment where I have to create a pygame using Tkinter, the objective is that you drive a Car and you have to dodge other cars that pass by, the problem I have comes to one part where you have to select gears using 'a' in your keyboard, and a green or red light have to be shown in the right upper corner, but the TCL shows me a very extensive error, that's what I need help with.

This is the part where I'm having problems

This is the TCL error message PART 1

This is the TCL error message PART 2



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source