在python中创建makefile
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/19329605/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Creating makefiles in python
提问by Scooby
I have two python programs. say a.py and b.py. I build an index in a.py and then run b.py which import a.py.
我有两个 python 程序。说 a.py 和 b.py。我在 a.py 中建立一个索引,然后运行 b.py 导入 a.py。
I want to make a python makefile to install the two porgrams such as I go to my makefile and run :
我想制作一个 python makefile 来安装两个 porgrams,比如我去我的 makefile 并运行:
./install - it installs the project in current directory ./a.py - interprets a.py ./b.py - interprets b.py
./install - 它在当前目录中安装项目 ./a.py - 解释 a.py ./b.py - 解释 b.py
Any idea how to make this or pointers where I could find resource for this ?
知道如何制作这个或指示我可以在哪里找到资源吗?
采纳答案by Emmett Butler
To get started with python distutils
, you just need to create a setup.py
file. See the python referencefor the documentation of setup.py
, and see a real example here.
要开始使用 python distutils
,您只需要创建一个setup.py
文件。有关的文档,请参阅python 参考setup.py
,并在此处查看真实示例。
Once you've made a setup.py
file that is appropriate to your project structure, you can install the project by running python setup.py install
. See thisfor additional commands.
一旦您制作了setup.py
适合您的项目结构的文件,您就可以通过运行安装项目python setup.py install
。见这额外的命令。