def set_executable(executable): ''' Sets the path to a python.exe or pythonw.exe binary used to run child processes on Windows instead of sys.executable. Useful for people embedding Python. ''' from multiprocessing.forking import set_executable set_executable(executable)
def set_executable(executable): """ Sets the path to a python.exe or pythonw.exe binary used to run child processes on Windows instead of sys.executable. Useful for people embedding Python. """ from multiprocessing.forking import set_executable set_executable(executable)
def __init__(self, server_url=None): super(EngineServer, self).__init__(server_url) self.modules = [] self.status = "free" self.jobs = 0 self.running = {} self.module_by_name = {} self.resource_by_name = {} # import multiprocessing, logging # logger = multiprocessing.log_to_stderr() # logger.setLevel(multiprocessing.SUBDEBUG) # log.debug('CWD: %s'%os.getcwd()) if os.name == 'nt': #log.debug('sys.argv: %s', sys.argv) python_ent_env = os.path.join(os.path.dirname(sys.argv[0]), 'python.exe') sys.argv = [ python_ent_env, 'bqengine\\bq\\engine\\controllers\\execone.py' ] import execone sys.modules['__main__'] = execone from multiprocessing.forking import set_executable set_executable(python_ent_env) #log.debug('sys.argv: %s', sys.argv) #log.debug('os.getcwd: %s', os.getcwd()) self.mpool = ProcessManager(POOL_SIZE) #self.module_resource = EngineResource() self.engines = { #'matlab': MatlabAdapter(), #'python': PythonAdapter(), #'shell' : ShellAdapter(), 'runtime': RuntimeAdapter(), #'lam' : LamAdapter(), } self.refresh()
def set_executable(executable): from multiprocessing.forking import set_executable set_executable(executable)
def set_executable(executable): from multiprocessing.forking import set_executable set_executable(executable)