How to convert python .py file into an executable file for use cross platform?

前端 未结 4 653
礼貌的吻别
礼貌的吻别 2020-12-28 08:33

I\'ve been searching through SO for a while now trying to come up with an answer to this but due to my inexperience with programming I don\'t understand much of the document

4条回答
  •  感动是毒
    2020-12-28 09:05

    1. Download py2exe
    2. Download this msvcp90.dll
    3. Copy your FileCode.py AND msvcp90.dll to C:\Python27\
    4. In C:\Python27\ create new text file, then enter this code inside it:
    from distutils.core import setup
    import py2exe
    setup(console=['Avril.py'])
    
    1. Replace Avril.py with YourFileName.py
    2. Save the file as setup.txt
    3. Open CMD and type this:

    cd C:\Python27\
    python setup.txt py2exe

    1. Now go to C:\Python27\dist\ and there's your .exe program.

    Source: Manvir Singh

提交回复
热议问题