make-executable is a simple Raspberry Pi command-line tool that allows you to make a Python script executable. It can be used like this: make-executable [option] your file name. It also has a tool option (-t/--tool) which allows you to run the script from any directory like a built in tool.
-
Pull the file
make-executable.pyonto your computer.cd "whatever/directory/you put your GitHub projects"
git clone "https://github.com/Sim3-14159/make-executable.git" -
Enter these commands:
cd make-executable/chmod +x make-executable.py
sudo mv make-executable.py /usr/local/bin/make-executable
-
Now you can use make-executable to make your own command-line tools!
-
You can use it like this:
make-executable your file name.py
or
make-executable -t your-file-name.py
- Python 3.x.
make-executableautomatically adds the line!# /usr/bin/env pythonat the beginning of the file if not present. If your default version of Python is Python 2.x, not 3.x, and you want to make a Python 3 script executable, it may not work.