Can someone tell me how to make my script callable in any directory?
My script simply returns the number of files in a directory. I would like it to work in any directory by invoking it, instead of first being copied there and then typing python myscript.py
I am using Mac OS X, but is there a common way to get it installed on Windows and Linux?
If your script starts with a suitable shebang line, such as:
And your script has the executable bit set (for Linux, OS X, and other Unix-like systems):
And the path to your script is in your PATH environment variable:
Then you can call
myscript.pyfrom wherever you are.