On my code when I use a button/entry command using the Tkinter python library my screen appears black.
Here is the first few lines of the code:
import random from time import sleep from tkinter import * import threading tk = Tk() HEIGHT = 1050 WIDTH = 1600 canvas = Canvas(tk, width=WIDTH, height=HEIGHT) tk.title("Times Tables game") canvas.pack() class Game: def Error(): raise Exception("There was an error") def Start(): global numOfQuestions global questionsClick questionsButton = Button(tk, text="How many questions would you like?", command=questionsClick) numOfQuestions = Entry(tk) questionsButton.pack() numOfQuestions.pack()
Ps canvas.mainloop() is at the end