两个问题:
rob*_*rit 34
使用forever.js很容易使用Python:
forever start -c python python_script.py
Run Code Online (Sandbox Code Playgroud)
要将它与virtualenv一起使用有点复杂,我使用bash脚本(调用它python_virtualenv)来做到这一点:
#!/bin/bash
# Script to run a Python file using the local virtualenv
source bin/activate
bin/python $@
Run Code Online (Sandbox Code Playgroud)
现在永远使用该脚本:
forever start -c ./python_virtualenv python_script.py
Run Code Online (Sandbox Code Playgroud)