0

so the answer to this question seems to be in the /usr/local/bin folder, which is fine for a single script file but my program has multiple .py files and folders containing HTML files which the program relies on like so:

program
    -templates
        file1.html
        file2.html
    script.py
    class.py
    another_class.py

How would I go about setting this up globally under linux?

3
  • Provide a setup.py that installs your package and any scripts that it provides. Commented Jun 23, 2015 at 14:55
  • @jonrsharpe how is this a duplicate of that answer? I'm not asking how to make setup.py file Commented Jun 23, 2015 at 15:06
  • But you want to know how to install your script globally and access the functionality in your package, which can be achieved using a setup.py. If that question doesn't answer yours, please edit to clarify what you still need to know. Commented Jun 23, 2015 at 15:07

1 Answer 1

1

You could put your program to /usr/loca/myprog and then create a symlink from /usr/local/myprog/scrip.py to /usr/loca/bin. This assumes it is script.py you want to be available as an executable globally. Alternatively, create a shell script /usr/local/bin/myprog.sh that invokes your python script.

#!/bin/sh
python /usr/local/myprog/script.py

Of course this is not really a clean solution. The suggestion in the comments to create a distutils package based on setup.py file is much better.

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

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.