Normally I would recommend placing global variables in a separate Python file and importing them. I would also separate the functions and classes into modules and packages. I am not recommending this because:
Talk to the instructor if you want to use more thant one file.
# ========================================================= # Program Name/Description # ========================================================= # Name: .................. # Date: mm/dd/yyyy # ========================================================= # # Description / Usage # # .................................................. # .................................................. # .................................................. # # ========================================================= # # Change History # # May 26, 2017 Developer Name # original code completed # # ========================================================= # Note: If a DVCS (like GIT) is used, some of the data # in this header would stored there. Pydoc could be # use to create documentation. # ========================================================= # --------------------------------------------------------- # --- import # --------------------------------------------------------- import sys # --------------------------------------------------------- # --- global variables # --------------------------------------------------------- buttonFont = ('arial', '14', 'bold') displayFont = ('courier', '12', 'normal') # --------------------------------------------------------- # --- classes # --------------------------------------------------------- # --------------------------------------------------------- # --- functions # --------------------------------------------------------- # --------------------------------------------------------- # --- main # --------------------------------------------------------- if __name__ == '__main__': if sys.version_info.major == 3: from tkinter import * from tkinter.font import * ##import tkinter as tk ##import tkinter.font as tkf py3 = True else: from Tkinter import * from tkFont import * ##import Tkinter as tk ##import tkFont as tkf py3 = False root = Tk() root.title('My Program') ##root.resizable(width=False,height=False) Grid.columnconfigure(root, 0, weight=1) Grid.rowconfigure(root, 0, weight=1) ........................ ........................ root.mainloop()