How do I make a python script a unix-able command?
Let's say i have a python script:
print "hello foo bar"
and i want to call the python script like a normal linux command, something that people can:
deb www.myfoobar.com foobar
deb-src www.myfoobar.com foobar
sudo apt-get install foobar
Then after installation, something that someone can just call from terminal:
$ foobar
hello foo bar
Put following shebang line at the top of the script.
#!/usr/bin/env python
Make a script executable using following command:
chmod +x foobar
Move the script to somewhere in the $PATH (for example: /usr/local/bin)
mv foobar /usr/local/bin
From Rob: For the creating and hosting a deb problem, you can use external services such as https://launchpad.net/ubuntu
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With