Make a py2exe exe run without a console?

后端 未结 2 612
一整个雨季
一整个雨季 2020-12-01 12:45

Does anyone know how to make an exe with py2exe run without the black console? and bundle up all the pyd files etc into just one exe file?

2条回答
  •  执笔经年
    2020-12-01 13:39

    For one exe file, use this setup (taken from this answer):

    from distutils.core import setup
    import py2exe, sys, os
    
    sys.argv.append('py2exe')
    
    setup(
        options = {'py2exe': {'bundle_files': 1, 'compressed': True}},
        windows = [{'script': "single.py"}],
        zipfile = None,
    )
    

提交回复
热议问题