Use is tkMessageBoxalmost identical to use os.systemand zenityto display a warning window.
import tkMessageBox as messagebox
import Tkinter as tk
root = tk.Tk()
root.withdraw()
messagebox.showwarning(
"Error",
"It is part of master thesis. \nThis script is safe but you should never open files from untrusted source. \nThanks for help!")
root.destroy()
To indicate that the tk window does not appear after compilation using py2exe, you will need to include it "dll_excludes": ["tcl85.dll", "tk85.dll"]inside your optionssetup, which excludes two DLLs that cause errors.
setup(options = {'py2exe': {'bundle_files': 1, 'compressed': True, "dll_excludes": ["tcl85.dll", "tk85.dll"])})