I have a need to invoke Python Program as deamon. I have created /etc/init.d scipt. Since I am distributing Pyo files only I need to run this using python -O myapp.pyo
Here is the start_stop_deamon command ( I have stripped everything except the main one)
I tried with quotes, double quotes, etc. But this does not run
start-stop-daemon -S -m -p -s /var/run/my-app.pid -x"/usr/bin/python2.7 -O /root/myapp.pyo"
BREL, wrap the python script with a bash script. This script will invoke python with -O
sonnyyu, using -O reduces python VM startup time (since your second run, first one will be slower). As often mentioned, with -O flag your program will NOT run faster, it will just START faster, because python won't need to compile the script
Thank you very much for the reply,
Currently I am distributing only a.pyc files ( bytecode) which does not need any arguments and serve almost same purpose as pyo files,
Though, I prefered pyo files, let me try out your option.
Sonnyyu,
Use .pyo file for security purpose? hide source code?