from tkinter import * import tkinter as tk import random f = 0 def test_print(): f = random.randint(0,118) master.update_idletasks() # creating Tk window