Python - create an EXE that runs code as written, not as it was when compiled

前端 未结 2 1492
情深已故
情深已故 2020-12-03 17:17

I\'m making a pygame program that is designed to be modular. I am building an exe with pygame2exe of the file main.py, which basically just imports the real main game and ru

2条回答
  •  野趣味
    野趣味 (楼主)
    2020-12-03 18:03

    Last summer I have been struggling with the same problem - build single .exe from python script. However there was no PyGame, but there was a PyQt5, which added some problems alike. None of the pure standard tools helped me.

    Finally I'd solved the problem with a chaine: make + Py2exe + 7Zip + Resource Hacker. This set gave me single .exe with all the resources onboard, which don't require installaton - so you can put it everywhere on windows box and run.

    Here's detailed article: exe built with cx_Freeze, PyQt5, Python3 can't import ExtensionLoader_PyQt5_QtWidgets.py and run

    Please, feel free to ask any questions.

提交回复
热议问题