Fixing specified .py and writing PID file.