0

I'm sorry if I asked the question in a funny way but, I did not know a better way to word it. I'm trying to combine this.

http://www.pygame.org/wiki/Pygame2exe?parent=CookBook

With this.

from distutils.core import setup
import py2exe

py2exe_options = { 'includes': ['pyttsx.drivers.sapi5', 'win32com.gen_py.C866CA3A-32F7-11D2-9602-     00C04F8EE628x0x5x4'],
               'typelibs': [('{C866CA3A-32F7-11D2-9602-00C04F8EE628}', 0, 5, 4)] }

setup(console=['main.py'], options = {'py2exe': py2exe_options})

I would really appreciate if someone could help. everything I tried gives an error. Thanks friends.

1 Answers1

0

Using the pygame2exe script that you linked, you need to add the list of extra includes ['pyttsx.drivers.sapi5', 'win32com.gen_py.C866CA3A-32F7-11D2-9602-00C04F8EE628x0x5x4'] to the setup options used - it looks like you can do that by overriding or changing self.extra_scripts = [] in BuildExe. You then also need to do something similar with your typelibs, thought it looks like pygame2exe doesnt support that directly.

The easiest thing for you to do would probably be to take a local copy of the pygame2exe and then modify the BuildExe class to add your specific options to this:

From:

options = {'py2exe': {'optimize': 2, 'bundle_files': 1, 'compressed': True, \
    'excludes': self.exclude_modules, 'packages': self.extra_modules, \
    'dll_excludes': self.exclude_dll,
    'includes': self.extra_scripts} },

To (this might need further tweaking:

options = {'py2exe': {'optimize': 2, 'bundle_files': 1, 'compressed': True, \
    'excludes': self.exclude_modules, 'packages': self.extra_modules, \
    'dll_excludes': self.exclude_dll,
    'includes': self.extra_scripts + ['pyttsx.drivers.sapi5', 'win32com.gen_py.C866CA3A-32F7-11D2-9602-00C04F8EE628x0x5x4'],
    'typelibs': [('{C866CA3A-32F7-11D2-9602-00C04F8EE628}', 0, 5, 4)]
}},

Let me know how you get on!

Tom Dalton
  • 6,122
  • 24
  • 35