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
Simply strip off the .py
extension by renaming the file. Then, you have to put the following line at the top of your file:
#!/usr/bin/env python
env
is a little program that sets up the environment so that the right python
interpreter is executed.
You also have to make your file executable, with the command
chmod a+x htswap
And dump it into /usr/local/bin
. This is cleaner than /usr/bin
, because the contents of that directory are usually managed by the operating system.