shell - How can I put a python program with multiple files in /usr/local/bin? -


i know if program 1 python script file, start shebang , put in /usr/local/bin invoke @ time command prompt.

however, if program multiple files, want 1 invokable command line? example, if i've got my_program.py , dependency.py, , my_program needs dependency, don't want dependency invokable?

as understand it, if dump both in /usr/local/bin, invoking either of names attempt execute them... want my_program visible, needs in same dir dependency module.

i know copy/paste them 1 single file feels wrong...

  1. put python files in folder , put folder installation directory (may in /usr/local/foldername).

  2. use chdir in script/s change directory file containing folder (may os.path.dirname(os.path.realpath(sys.argv[0]))) import dependencies there, or use absolute path.

  3. now make symbolic link of executable file , put in /usr/local/bin.


Comments

Popular posts from this blog

c# - Validate object ID from GET to POST -

node.js - Custom Model Validator SailsJS -

php - Find a regex to take part of Email -