def exec_script(script_filename, env=None, *args):
 script_filename = os.path.basename(script_filename)
 script_filename = os.path.join(os.path.dirname(__file__), 'subproc', script_filename)
 if (not os.path.exists(script_filename)):
  raise SystemError('To prevent misuse, the script passed to PyInstaller.utils.hooks.exec_script must be located in the `PyInstaller/utils/hooks/subproc` directory.')
 cmd = [script_filename]
 cmd.extend(args)
 return __exec_python_cmd(cmd, env=env)

def exec_script ( script_filename , env = None , * args ) : script_filename = os . path . basename ( script_filename ) script_filename = os . path . join ( os . path . dirname ( __file__ ) , 'subproc' , script_filename ) if ( not os . path . exists ( script_filename ) ) : raise SystemError ( 'To prevent misuse, the script passed to PyInstaller.utils.hooks.exec_script must be located in the `PyInstaller/utils/hooks/subproc` directory.' ) cmd = [ script_filename ] cmd . extend ( args ) return __exec_python_cmd ( cmd , env = env )
executes a python script in an externally spawned interpreter .