If your script starts with a suitable shebang line, for example:
And your script has a set of executable bits (for Linux, OS X and other Unix-like systems):
chmod +x myscript.py
And the path to your script is in the PATH environment variable:
export PATH=${PATH}:`pwd`
SET PATH=%PATH%;\path\to
myscript.py, .