473,395 Members | 1,539 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Put the output from all my programs in one place

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.
Sep 1 '08 #1
1 1056
On Sep 2, 6:30*am, Jesse Aldridge <JesseAldri...@gmail.comwrote:
I want to put all the output from all of my python programs in one
place.
Have you considered using the python logging module?

http://docs.python.org/lib/module-logging.html
http://www.onlamp.com/pub/a/python/2...2/logging.html

You can define handlers within a program or via a config file. Then
you just need to specify that they all log to the same location, which
you could define via an environment variable...
Sep 2 '08 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

54
by: bnp | last post by:
Hi, I took a test on C. there was an objective question for program output type. following is the program: main() { char ch; int i =2;
37
by: nobody | last post by:
I am writing a framework that other developers will write plug-ins for. I would like for one of the features of the framework to be to intercept all text written to stdout/stderr and prepend...
24
by: tizi_de | last post by:
Hello all, I'm looking for a sample program in C to print out lines not to the standard MS Dos Box but into a different control e.g. text control. Has C the possibility to do printouts to a...
19
by: Chad | last post by:
Okay, let's say I have an exotic os that limits how much goes to stdout. When I go like.. #include <stdio.h> int main(void) { int i=0; for(i=0; i< 10; i++) { printf("a \n");
5
by: Muffin | last post by:
I am trying to capture the out put of a command line program. Let say ping or maybe better yet nslookup. I would like to launch and then capture all the output , redirect it I guess to a string...
2
by: arnuld | last post by:
I have 2 programs. 1st PROGRAM: copies an input file to standard output but it does so at the expense of deleting all white-space (space, tabs, newlinies etc). 2nd PROGRAM: copies the input...
4
by: maria | last post by:
I only use C++ with Visual Studio 6.0 for string manipulations in thousands of HTML pages on my website. Many times, the output files of many of my C++ programs contain a spanish question mark (¿)...
27
by: CarlosMB | last post by:
Hello, I am writing code that uses a DLL which is supposed to print to console some useful information but for some reason it is not doing so. The environment is a bit complex to explain but...
5
by: jacob navia | last post by:
One of the many questions asked by people is that even if they write into standard output, the output doesn't show in the screen. This happens in windows systems since quite a long time. To...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.