I was creating a Python program that I want to be able to call anywhere in my shell.
Suppose, for the sake of simplicity, that it is a hello.py
program that output a "Hello World!" when called.
Sure, I can add #!/usr/bin/python
to the first line, remove the .py
extension and put it in some place in $PATH
.
Then, I wished that other users could easily install it, so I was thinking about packaging this program and uploading it as a module to pip.
My question is: can I let people use it without having to type $ python -m hello
, only calling $ hello
instead? The only way I've been able to use python programs installed by pip until now is using $ python -m program_name
.
Tried to search something about "global installation in pip" and "using pip packages without m flag" but didn't succeed.