I am building compiled executable as follows.
Using following versions:
OS: Windows-7-6.1.7601-SP1
Python: 2.7.3 (default, Apr 10 2012, 23:31:26) [MSC v.1500 32 bit (Intel)]
cx_Freeze: 4.2.3
I have this code hello_tkinter.py
:
from Tkinter import *
import ttk
class Main(Tk):
def __init__(self, *args, **kwargs):
Tk.__init__(self, *args, **kwargs)
self.frame = ttk.Frame(self)
self.frame.pack(expand=True, fill=BOTH, padx=5, pady=5)
self.button = ttk.Button(self.frame, text="Test")
self.button.pack(expand=True, fill=BOTH)
root = Main()
root.mainloop()
I call this script installed with cx_freeze
:
c:\Python27\Scripts\cxfreeze.bat hello_tkinter.py --target-dir=Bin/tkinter --base-name=Win32GUI --target-name=hello_tkinter.exe
And I get the directory containing:
tcl\
tk\
_ctypes.pyd
_tkinter.pyd
bz2.pyd
hello_tkinter.exe
MSVCR90.dll
python27.dll
tcl85.dll
tk85.dll
unicodedata.pyd
It works fine and even if I move the directory. You did take the whole directory, not just the exe, did not you? The executable was also tested on Windows XP without Python installed.