Compile PyPy to Exe

后端 未结 2 1910
一向
一向 2020-12-15 03:10

I know how to compile CPython file to exe using cx_freeze but is it possible to compile a simple program using PyPy to Exe ?

2条回答
  •  慢半拍i
    慢半拍i (楼主)
    2020-12-15 03:54

    This is a py2exe solution that might work for you: compile.py

    #!/usr/bin/env python
    # Corey Goldberg
    
    from distutils.core import setup
    import py2exe
    import sys
    
    if len(sys.argv) == 2:
        entry_point = sys.argv[1]
        sys.argv.pop()
        sys.argv.append('py2exe')
        sys.argv.append('-q')
    else:
        print 'usage: compile.py \n'
        raw_input('press ENTER to exit...')
        sys.exit(1)
    
    opts = {
        'py2exe': {
            'compressed': 1,
            'optimize': 2,
            'bundle_files': 1
        }
    }
    
    setup(console=[entry_point], options=opts, zipfile=None)
    

提交回复
热议问题