Queue
을 만들어 별도의 프로세스로 전달할 수 있습니다.
from multiprocessing import Process, Queue
def f(q):
q.put([42, None, 'hello'])
if __name__ == '__main__':
q = Queue()
p = Process(target=f, args=(q,))
p.start()
print q.get() # prints "[42, None, 'hello']"
p.join()
예 : 다음 Python Docs부터 wx.py.shell.Shell Docs에서 constructur 매개 변수는 내가 그것을 시도하지 않은
__init__(self, parent, id, pos, size, style, introText, locals,
InterpClass, startupScript, execStartupScript, *args, **kwds)
으로 주어 지지만,
locals
지역 변수의 사전, 당신이 할 수 있습니다 껍질에 전달하십시오. 그래서, 다음을 시도합니다 :
def f(cmd_queue):
shell = wx.py.shell.Shell(parent, id, pos, size, style, introText, locals(),
...)
q = Queue()
p = Process(target=f, args=(q,))
p.start()
를 쉘 내부, 당신은 그 때 실행되는 부모 프로세스에서 읽을 수 다음이 cmd_queue
로 명령을 넣을 수 있어야합니다.
더 자세히 질문 할 수 있겠습니까? – kcwu
보통 wx.py.shell.Shell을 만들면 명령을 GUI를 실행중인 Python의 현재 프로세스로 보냅니다. 명령을 내가 만든 다른 프로세스로 이동 시키길 원합니다. –