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...
put python files in folder , put folder installation directory (may in /usr/local/foldername).
use
chdir
in script/s change directory file containing folder (mayos.path.dirname(os.path.realpath(sys.argv[0]))
) import dependencies there, or use absolute path.now make symbolic link of executable file , put in /usr/local/bin.
Comments
Post a Comment