The problem is that you write from tkinter import *
after from graphics import *
. Some objects defined in the graphics.py package get shadowed by objects defined in the tkinter package. In this case, the graphics.py Text class is shadowed by the tkinter Text widget. The best thing to do is to avoid the import *
idiom, especially with tkinter. You can do
import tkinter as tk
...
root = tk.Tk()
The code works this way. It would be a good idea to add a button to kill the window and exit the game, because I had to kill the process from the outside.