FindPython: Support script mode

Fixes: #18827
Status Job ID Name Coverage
  External
passed ghostflow-check-master

passed ghostflow-stager

passed ghostflow-stager

passed ghostflow-stager

passed ghostflow-stager

passed ghostflow-stager