If your script starts with a suitable shebang line, such as:
#!/usr/bin/env python
And your script has the executable bit set (for Linux, OS X, and other Unix-like systems):
chmod +x myscript.py
And the path to your script is in your PATH environment variable:
export PATH=${PATH}:`pwd` # on Unix-like systems
SET PATH=%PATH%;patho # on Windows
Then you can call myscript.py
from wherever you are.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…