How to auto-restart bottle server when Python file changes using entr

Note: I do not recommend using entr any more since for me it doesn’t work reliably. I recommend using nodemon instead, see How to auto-restart bottle server when Python file changes using nodemon

Assuming you have a Python script server.py that you want to auto-reload every time the file changes, use the following script using entr:

ls *.py | entr python server.py

The ls *.py tells entr which files to watch for changes.