chmod +x; requirements.txt
Closed this issue · 3 comments
By marking the script as executable (chmod +x quad.py
), this enables one to do ./quad.py blah
instead of python quad.py blah
.
Additionally, I strongly recommend adding a requirements.txt
file, with 1 pip package name per line. By defining one's dependencies this way, others can simply install them like so:
sudo pip3 install -r requirements.txt
(of course it varies slightly by platform, but the principle is the same)
Thanks for the feedback. The shebang at the top of the file #!/usr/bin/env python3
marks the script as executable, so you should be able to run quad.py
directly.
The requirements.txt
point you make is valid, and reminded me that the command to install all required packages is actually just
pip install numpy tqdm imageio imageio-ffmpeg
Which is already a one-liner. Since this is just a simple Python file and won't change much in the future, I feel a requirements.txt
is a bit overkill.
No, the shebang is only half of the puzzle. You need to ensure that the file is marked executable too, otherwise you get a permission denied error when you attempt to execute it like that.
Since this is just a simple Python file and won't change much in the future, I feel a
requirements.txt
is a bit overkill.
True, but for the uninitiated its easier to tell them to pip3 install -r requirements.txt
rather than specify a like of dependencies and potentially have an obscure spelling mistake.
Marking the file as executable is up to the person who downloads the file. I have no control over that.
Concerning the pip install
, it's very easy to copy and paste the requirements from the README into the terminal.