Run Python with Forever

By August 9, 2018Linux

It is easy to use Python with forever.js:

[raw]

forever start -c python python_script.py

[/raw]

To use it with virtualenv is a little bit more complicated, I did it using a bash script (call it python_virtualenv):

[raw]

#!/bin/bash
# Script to run a Python file using the local virtualenv
source bin/activate
bin/python $@

[/raw]

Now use that script with forever:

[raw]

forever start -c ./python_virtualenv python_script.py

[/raw]

Leave a Reply