问题
I've been looking around for hours now. The only thing that makes sense to me is http://fnch.users.sourceforge.net/portablepygtkwindows.html But it takes up >40MB of space and it is too big for me.
Other tutorials are either too complicated for me to go through them or the results I obtained didn't work.
I've tried py2exe but the import gtk
fails.
I've tried pyinstaller. The GTK files were included but not the glade file.
I would wish to have it all in a single standalone .exe. But now my priority is to have it properly working in windows without Python. Any effort to help is much appreciated.
回答1:
Some instructions on py2exe and pygtk are available. You should be able to have your whole program in a single exe file, but not the GTK library, which will need to be copied:
Once that's done, you'll need to copy the etc, lib and share directories from your GTK+ install (not the pygtk install) to the dist dir py2exe created.
Looks you can also ship data files with pyinstaller.
来源:https://stackoverflow.com/questions/13799317/converting-pygtk-to-exe