簡體   English   中英

如何結合這兩個py2exe程序。 它們是pygame2exe和pyttsx.exe

[英]How do I combine these two py2exe programs. They are pygame2exe and a pyttsx.exe

很抱歉,我以一種有趣的方式問了這個問題,但是我不知道有一種更好的措詞。 我正在嘗試結合這一點。

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

有了這個。

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})

如果有人可以提供幫助,我將不勝感激。 我嘗試的一切都給出了錯誤。 謝謝朋友。

使用鏈接的pygame2exe腳本,您需要在使用的設置選項中添加其他包含項的列表['pyttsx.drivers.sapi5', 'win32com.gen_py.C866CA3A-32F7-11D2-9602-00C04F8EE628x0x5x4']就像您可以通過覆蓋或更改self.extra_scripts = []BuildExe 那么你還需要與你類似的typelibs ,以為它看起來像pygame2exe犯規支持直接。

對您而言,最簡單的操作可能是獲取pygame2exe的本地副本,然后修改BuildExe類以向其中添加您的特定選項:

從:

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} },

到(這可能需要進一步調整:

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)]
}},

讓我知道你是怎么辦的!

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM