4

I used PyQt to make a GUI for my program, but it has multiple .py files, 2 are them are classes, and one launches the code. So I was wondering, how would I combine them into one whole program?

Here is a download link to all the .py files I will be combining: http://www.multiupload.com/CJDL639CTH

S.Lott
  • 384,516
  • 81
  • 508
  • 779
Casey
  • 444
  • 1
  • 7
  • 22
  • 2
    Have you actually tried using py2xe yet? All you need is a proper setup.py file with the appropriate py2exe hook to your app's entry point. Py2exe should take care of the rest unless you have some funky packaging and/or dependancies. – Mark Gemmill Oct 31 '11 at 05:54

2 Answers2

3

Shed Skin can turn your program into a fast executable, but maybe that doesn't work for your program.

With py2exe and a setup.py like this you can easily turn your Python 2.x code in Windows into an executable with only one extra file, unlike cx_Freeze's flat output of 11 files. For Python 3, use cx_Freeze, or py2exe.

The key part is:

    options={
            'py2exe': {
                    'compressed': 2,
                    'optimize': 2,
                    'includes': includes,
                    'excludes': excludes,
                    'packages': packages,
                    'dll_excludes': dll_excludes,
                    'bundle_files': 1,  # 1 = .exe; 2 = .zip; 3 = separate
                    'dist_dir': 'dist',  # Put .exe in dist/
                    'xref': False,
                    'skip_archive': False,
                    'ascii': False,
                    'custom_boot_script': '',
                    #'unbuffered': True,  # Immediately flush output.
            }
    },
    zipfile=None,  # Put libs into .exe to save space.
Cees Timmerman
  • 17,623
  • 11
  • 91
  • 124
0

Use squeeze than ExeMaker Tool. May be able to use Py2Exe after squeeze. Have never used Py2Exe.

Joe McGrath
  • 1,481
  • 10
  • 26