import sys
from cx_Freeze import setup, Executable
build_exe_options = {'packages': ['os','tkinter','random',
'heapq','collections','sys','pickle']}
base = None
if sys.platform == "win32":
base = "Win32GUI"
setup( name = 'Game',
version = '0.02',
description = 'My GUI application!',
options = {'build_exe': build_exe_options},
executables = [Executable('Game.py', base=base)])
here's the code of the setup
from tkinter import *
value_a = 'hahaha'
a =messagebox.showinfo('laugh',value_a)
and the code that would executed
the erorr is Nameerorr : name "messagebox" is not defined
when I typed python 123.py build
or python haha.py build
in cmd
I already used import *
, if I run the code it shows message but neither in cmd nor .exe
Should I use import tkinter as tk
? But it is difficult to read my code by adding "tk", I want to keep import *
so that no "tk.xxx" is needed and it will still works on exe.