#!/usr/bin/env python
from esys.lsm.util import InstallInfo
from esys.lsm.util import PathSearcher

import os
import sys

python = PathSearcher().find("python")
argList = []
if (len(sys.argv) > 1):
    moduleName = sys.argv[1]
    exec("import " + moduleName)
    moduleFileName = eval(moduleName + ".__file__")
    argList.append(moduleFileName)
    if (len(sys.argv) > 2):
      argList += sys.argv[2:]

os.execv(
  python,
  [
    os.path.split(python)[1], # argv[0]
  ] +\
  argList
)
