3

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.

I want to make a python makefile to install the two porgrams such as I go to my makefile and run :

./install - it installs the project in current directory ./a.py - interprets a.py ./b.py - interprets b.py

Any idea how to make this or pointers where I could find resource for this ?

3
  • 2
    Have you considered distutils? It's a commonly used package that does what it sounds like you want to do. Commented Oct 12, 2013 at 1:52
  • have but found it a little confusing. Could provide with some detail to help get me started ? Commented Oct 12, 2013 at 1:59
  • Just make a.py build the index if it doesn't already exist. That way the first time it's imported it will take care of things. Commented Oct 12, 2013 at 2:26

1 Answer 1

3

To get started with python distutils, you just need to create a setup.py file. See the python reference for the documentation of setup.py, and see a real example here.

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 this for additional commands.

Sign up to request clarification or add additional context in comments.

1 Comment

In addition to @Emmett's answer, you might want to check out The Hitchhiker's Guide to Packaging 1.0 documentation, especially the Quick start tutorial

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.