Without passing as a parameter... i would say to create your Groot within setup directly and pass that back to the main program then. Often you will have a settings file with static data that you import to many modules. You should be cautious to use globals so often.
setup.py
setup.py
# MODULE "setup.py" in moduletest import tkinter as tk Groot = tk.Tk() def setup(): # Create and load the display label into the window prompt = ' Press any key ' Glabel1 = tk.Label(Groot, text=prompt, width=len(prompt), bg='yellow') Glabel1.pack() return Grootmain program
import setup #<- imports go at top ... #Groot = tk.Tk() # Create the GLOBAL root window Glabel1 = [] # Global Label identifier GCOUNT = 0 # Global Keystroke counter # Create and load the display label Groot = setup.setup() ...
Recommended Tutorials: