I have a python script, which has multiple command line options. I want to make this script runnable without having to type "python myscript.py" and without having to be in the same directory as the script. For example, if one installs git on linux, regardless of which directory the user is in, the user can do "git add X, etc..". So, an example input I would like is "myscript -o a,b,c -i" instead of "python myscript.py -o a,b,c -i". I already added "#! /usr/bin/env python" to the top of my script's code, which makes it executable when I type "./myscript", however I don't want the ./, and I want this to work from any directory.
Your script needs to be in a location searchable via your PATH. On Unix/Linux systems, the generally accepted location for locally-produced programs and scripts that are not part of the system is /usr/local/bin. So, make sure your script is executable by running chmod +x myscript, then move it to the right place with sudo mv myscript /usr/local/bin (while in the directory containing myscript). You'll need to enter an admin's password, then you should be all set.
Making python script executable from any directory