func (py *python) getWrapperScriptPath() string {
	scriptPath := os.Getenv("NUCLIO_PYTHON_WRAPPER_PATH")
	if len(scriptPath) == 0 {
		return "/opt/nuclio/_nuclio_wrapper.py"
	}
	return scriptPath
}
TODO: Global processor configuration, where should this go?
package python
import (
	"fmt"
	"io"
	"os"
	"os/exec"
	"strconv"
	"strings"
	"github.com/nuclio/nuclio/pkg/common"
	"github.com/nuclio/nuclio/pkg/processor/runtime"
	"github.com/nuclio/nuclio/pkg/processor/runtime/rpc"
	"github.com/nuclio/errors"
	"github.com/nuclio/logger"
)
type python struct {
	*rpc.AbstractRuntime
	Logger        logger.Logger
	configuration *runtime.Configuration
}
func NewRuntime(parentLogger logger.Logger, configuration *runtime.Configuration) (runtime.Runtime, error) {
	var err error
	newPythonRuntime := &python{
		configuration: configuration,
		Logger:        parentLogger.GetChild("logger"),
	}
	newPythonRuntime.AbstractRuntime, err = rpc.NewAbstractRuntime(newPythonRuntime.Logger,
		configuration,
		newPythonRuntime)
	if err != nil {
		return nil, errors.Wrap(err, "Failed to create runtime")
	}
	return newPythonRuntime, nil
}
func (py *python) RunWrapper(socketPath string) (*os.Process, error) {
	wrapperScriptPath := py.getWrapperScriptPath()
	py.Logger.DebugWith("Using Python wrapper script path", "path", wrapperScriptPath)
	if !common.IsFile(wrapperScriptPath) {
		return nil, errors.Errorf("Can't find wrapper at %q", wrapperScriptPath)
	}
	handler := py.getHandler()
	py.Logger.DebugWith("Using Python handler", "handler", handler)
	pythonExePath, err := py.getPythonExePath()
	if err != nil {
		py.Logger.ErrorWith("Can't find Python exe", "error", err)
		return nil, err
	}
	py.Logger.DebugWith("Using Python executable", "path", pythonExePath)
	env := os.Environ()
	env = append(env, py.GetEnvFromConfiguration()...)
	envPath := fmt.Sprintf("PYTHONPATH=%s", py.getPythonPath())
	py.Logger.DebugWith("Setting PYTHONPATH", "value", envPath)
	env = append(env, envPath)
	args := []string{
		pythonExePath, "-u", wrapperScriptPath,
		"--handler", handler,
		"--socket-path", socketPath,
		"--platform-kind", py.configuration.PlatformConfig.Kind,
		"--namespace", py.configuration.Meta.Namespace,
		"--worker-id", strconv.Itoa(py.configuration.WorkerID),
		"--trigger-kind", py.configuration.TriggerKind,
		"--trigger-name", py.configuration.TriggerName,
	}
	if py.resolveDecodeEvents() {
		args = append(args, "--decode-event-strings")
	}
	py.Logger.DebugWith("Running wrapper", "command", strings.Join(args, " "))
	cmd := exec.Command(args[0], args[1:]...)
	cmd.Env = env
	cmd.Stdout = os.Stdout
	cmd.Stderr = os.Stderr
	return cmd.Process, cmd.Start()
}
func (py *python) WaitForStart() bool {
	return true
}
func (py *python) getHandler() string {
	return py.configuration.Spec.Handler
}