J
Jesse Aldridge
I want to put all the output from all of my python programs in one
place. I've been trying to get this working for the last few days,
but there are lots of annoying little details that are making the
process quite difficult. I'm wondering if anyone can help me get this
working.
Currently I have one program called Output_Displayer.py This is a
wxPython app that uses the aui tabbed interface. Basically it's just
a frame with tabs where each tab contains one multi-line text control
which displays the stdout and stderr messages for one program. I make
one tab for each running program. I may change the way the interface
works in the future, but the basic idea is just that it displays the
stdout and stderr messages for all my programs.
One thing I've tried is creating an output function to replace the
print statement. This new function writes to a file. I made it so
that Output_Displayer polls for this file, reads it if it exists,
displays it's contents, and then deletes it. This works for standard
output, but of course this doesn't work for stderr messages.
Another thing I've tried is redirecting stdout and stderr to files and
having Output_Displayer read those files. But I want the output to
displayed "live" -- streaming, rather than waiting for the program to
finish running. I think I'm having issues with input blocking while
trying to read from these files when redirecting the streams. It
seems I can't read the files until the program finishes running? In
that case, I have another problem of determining whether or not the
program has finished running. How can I detect this?
I don't think I want to use subprocess for this, although I'm willing
to if I can't get it working without it. I would prefer to have
Output_Displayer be completely independent from my other programs
rather than running them as children or something.
Anyway, I've tried a bunch of different things and am more or less
drowning in technical details. Has anyone done something like this
before? I'd appreciate any help I can get.
place. I've been trying to get this working for the last few days,
but there are lots of annoying little details that are making the
process quite difficult. I'm wondering if anyone can help me get this
working.
Currently I have one program called Output_Displayer.py This is a
wxPython app that uses the aui tabbed interface. Basically it's just
a frame with tabs where each tab contains one multi-line text control
which displays the stdout and stderr messages for one program. I make
one tab for each running program. I may change the way the interface
works in the future, but the basic idea is just that it displays the
stdout and stderr messages for all my programs.
One thing I've tried is creating an output function to replace the
print statement. This new function writes to a file. I made it so
that Output_Displayer polls for this file, reads it if it exists,
displays it's contents, and then deletes it. This works for standard
output, but of course this doesn't work for stderr messages.
Another thing I've tried is redirecting stdout and stderr to files and
having Output_Displayer read those files. But I want the output to
displayed "live" -- streaming, rather than waiting for the program to
finish running. I think I'm having issues with input blocking while
trying to read from these files when redirecting the streams. It
seems I can't read the files until the program finishes running? In
that case, I have another problem of determining whether or not the
program has finished running. How can I detect this?
I don't think I want to use subprocess for this, although I'm willing
to if I can't get it working without it. I would prefer to have
Output_Displayer be completely independent from my other programs
rather than running them as children or something.
Anyway, I've tried a bunch of different things and am more or less
drowning in technical details. Has anyone done something like this
before? I'd appreciate any help I can get.