[wxPython-mac] Problems with wx.Process & wx.Execute
John Jackson
jjackson at pobox.com
Fri Mar 14 22:13:33 PDT 2008
Yes, I was half-way there by remembering to use the full path to
python on my system.
Here's a patch for the "Process" demo: replace the "OnIdle" method with
def OnIdle(self, evt):
if self.process is not None:
stream = self.process.GetInputStream()
if stream.CanRead():
text = stream.read()
self.out.AppendText(text)
stream = self.process.GetErrorStream()
if stream.CanRead():
text = stream.read()
self.out.AppendText("Errors:\n%s" % text)
This way, an error like mine will show up.
Also, perhaps a test should be added to "OnSendText " for the output
stream, because I did somehow manage to get a condition where that
failed (stream was None):
def OnSendText(self, evt):
text = self.inp.GetValue()
self.inp.SetValue('')
self.log.write('OnSendText: "%s"\n' % text)
# self.process.GetOutputStream().write(text + '\n')
stream = self.process.GetOutputStream()
if stream:
stream.write(text + '\n')
self.inp.SetFocus()
I had filed a bug report (#1912883); I've updated it, and asked that
the debug warnings get turned off, as they are just confusing the
issue...
I've gotten further -- I can start and stop the server --, but am
still having a problem with
1. the initial output from the process getting lost (at one I _was_
getting it, but not anymore!)
2. wx.EVT_END_PROCESS never happening and associated method never
being called.
On Mar 13, 2008, at 8:13 AM, Robin Dunn wrote:
> John Jackson wrote:
>> However, what I was doing wrong was that the expansion of ~
>> doesn't work:
>
> Sorry, I should have remembered that. I've run into it before
> myself. The various command-line expansions like ~ and etc. is
> purely a function of the shell, not the system exec APIs, and since
> you're executing Python directly there isn't a shell to do that
> work for you.
>
>
> --
> Robin Dunn
> Software Craftsman
> http://wxPython.org Java give you jitters? Relax with wxPython!
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: wxPython-mac-unsubscribe at lists.wxwidgets.org
> For additional commands, e-mail: wxPython-mac-help at lists.wxwidgets.org
>
______________
John Jackson
More information about the wxpython-mac
mailing list