;ò Wï¦Cc@s’dkZdeifd„ƒYZd„ZdZedjoPdkZdkZdkZei dei i ei dƒgei dƒndS( Ns TestPanelcBsGtZd„Zd„Zd„Zd„Zd„Zd„Zd„ZRS(NcCstii|||ƒ||_t|_|i ti |i ƒ|i ti |i ƒti|ddƒ}ti|ddƒ|_ti|ddƒ|_ti|dddtitiBtiBƒ|_ti|dddtiƒ|_ti|ddƒ|_ti|ddƒ|_|iitƒ|iitƒ|iitƒ|i ti|i|iƒ|i ti|i |iƒ|i ti|i!|iƒ|i ti"|i |iƒti#ti$ƒ}|i&|d ti'ƒ|i&|id ti'ti(Bti)Bd ƒ|i&|id ƒti#ti$ƒ}|i&|id ti'ƒ|i&|id ti(d ƒ|i&|id ti(d ƒti#ti+ƒ}|i&|d ti-ti.Bd ƒ|i&|id ti-ti.Bd ƒ|i&|d ti-ti.Bd ƒ|i/|ƒ|i0t1ƒdS( Niÿÿÿÿs Command line:spython -u data/echo.pysExecutessstylesSends Close Streamiiii (2swxsPanels__init__sselfsparentsIDslogsNonesprocesssBindsEVT_IDLEsOnIdlesEVT_END_PROCESSsOnProcessEndeds StaticTextspromptsTextCtrlscmdsButtonsexBtns TE_MULTILINEs TE_READONLYsTE_RICH2soutsTE_PROCESS_ENTERsinpssndBtnstermBtnsEnablesFalses EVT_BUTTONs OnExecuteBtns OnSendTexts OnCloseStreamsEVT_TEXT_ENTERsBoxSizers HORIZONTALsbox1sAdds ALIGN_CENTERsLEFTsRIGHTsbox2sVERTICALssizersEXPANDsALLsSetSizers SetAutoLayoutsTrue(sselfsparentsIDslogspromptssizersbox2sbox1((sg/mnt/gmirror/ports/x11-toolkits/py-wxPython26-common/work/wxPython-src-2.6.3.3/wxPython/demo/Process.pys__init__sD   !* #  cCs;|itj o'|iiƒ|iiƒt|_ndS(N(sselfsprocesssNonesDetachs CloseOutput(sself((sg/mnt/gmirror/ports/x11-toolkits/py-wxPython26-common/work/wxPython-src-2.6.3.3/wxPython/demo/Process.pys__del__>s  cCsÄ|iiƒ}ti|ƒ|_|iiƒti|ti|iƒ}|i i d||fƒ|i i tƒ|ii tƒ|ii tƒ|ii tƒ|ii tƒ|i iƒdS(NsOnExecuteBtn: "%s" pid: %s (sselfscmdsGetValueswxsProcesssprocesssRedirectsExecutes EXEC_ASYNCspidslogswritesinpsEnablesTruessndBtnstermBtnsFalsesexBtnsSetFocus(sselfsevtscmdspid((sg/mnt/gmirror/ports/x11-toolkits/py-wxPython26-common/work/wxPython-src-2.6.3.3/wxPython/demo/Process.pys OnExecuteBtnEs cCs^|iiƒ}|iidƒ|iid|ƒ|iiƒi|dƒ|ii ƒdS(NssOnSendText: "%s" s ( sselfsinpsGetValuestextsSetValueslogswritesprocesssGetOutputStreamsSetFocus(sselfsevtstext((sg/mnt/gmirror/ports/x11-toolkits/py-wxPython26-common/work/wxPython-src-2.6.3.3/wxPython/demo/Process.pys OnSendTextUs cCs!|iidƒ|iiƒdS(NsOnCloseStream (sselfslogswritesprocesss CloseOutput(sselfsevt((sg/mnt/gmirror/ports/x11-toolkits/py-wxPython26-common/work/wxPython-src-2.6.3.3/wxPython/demo/Process.pys OnCloseStream]scCsT|itj o@|iiƒ}|iƒo |iƒ}|ii |ƒqPndS(N( sselfsprocesssNonesGetInputStreamsstreamsCanReadsreadstextsouts AppendText(sselfsevtstextsstream((sg/mnt/gmirror/ports/x11-toolkits/py-wxPython26-common/work/wxPython-src-2.6.3.3/wxPython/demo/Process.pysOnIdlecs   cCsÌ|iid|iƒ|iƒfƒ|iiƒ}|i ƒo |i ƒ}|i i |ƒn|iiƒt|_|iitƒ|iitƒ|iitƒ|iitƒ|iitƒdS(Ns&OnProcessEnded, pid:%s, exitCode: %s (sselfslogswritesevtsGetPids GetExitCodesprocesssGetInputStreamsstreamsCanReadsreadstextsouts AppendTextsDestroysNonesinpsEnablesFalsessndBtnstermBtnscmdsTruesexBtn(sselfsevtsstreamstext((sg/mnt/gmirror/ports/x11-toolkits/py-wxPython26-common/work/wxPython-src-2.6.3.3/wxPython/demo/Process.pysOnProcessEndedls&    ( s__name__s __module__s__init__s__del__s OnExecuteBtns OnSendTexts OnCloseStreamsOnIdlesOnProcessEnded(((sg/mnt/gmirror/ports/x11-toolkits/py-wxPython26-common/work/wxPython-src-2.6.3.3/wxPython/demo/Process.pys TestPanels 7     cCst|d|ƒ}|SdS(Niÿÿÿÿ(s TestPanelsnbslogswin(sframesnbslogswin((sg/mnt/gmirror/ports/x11-toolkits/py-wxPython26-common/work/wxPython-src-2.6.3.3/wxPython/demo/Process.pysrunTestssd

wx.Process

wx.Process lets you get notified when an asyncronous child process started by wxExecute terminates, and also to get input/output streams for the child process's stdout, stderr and stdin.

This demo launches a simple python script that echos back on stdout lines that it reads from stdin. You can send text to the echo process' stdin by typing in the lower textctrl and clicking Send.

Clicking the Close Stream button will close the demo's end of the stdin pipe to the child process. In our case that will cause the child process to exit its main loop. s__main__sii( swxsPanels TestPanelsrunTestsoverviews__name__ssyssossrunsmainspathsbasenamesargv(ssyssrunsoverviewsrunTestswxsoss TestPanel((sg/mnt/gmirror/ports/x11-toolkits/py-wxPython26-common/work/wxPython-src-2.6.3.3/wxPython/demo/Process.pys?s {