How to build a single python file from multiple scripts?

前端 未结 8 1787
终归单人心
终归单人心 2020-12-24 01:30

I have a simple python script, which imports various other modules I\'ve written (and so on). Due to my environment, my PYTHONPATH is quite long. I\'m also using Python 2.

8条回答
  •  难免孤独
    2020-12-24 02:02

    Have you taken into considerations Automatic script creation of distribute the official packaging solution.

    What you do is create a setup.py for you program and provide entry points that will be turned into executables that you will be able run. This way you don't have to change your source layout while still having the possibility to easily distribute and run you program.

    You will find an example on a real app of this system in gunicorn's setup.py

提交回复
热议问题