I\'m writing a pretty basic application in python (it\'s only one file at the moment). My question is how do I get it so the python script is able to be run in /usr/bin without
The first line of the file should be
#!/usr/bin/env python
You should remove the .py
extension, and make the file executable, using
chmod ugo+x htswap
EDIT: Thomas points out correctly that such scripts should be placed in /usr/local/bin
rather than in /usr/bin
. Please upvote his answer (at the expense of mine, perhaps. Seven upvotes (as we speak) for this kind of stuff is ridiculous)