473,385 Members | 1,582 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,385 software developers and data experts.

replacments for stdio?

hi,
i was wondering if anyone have written a GUI module that can
function as a replacment for stdin/stdout? ie. has a file like
interface, by which one could just assaign it to sys.stdout or
sys.stdin and have all your prints and raw_inputs and other such things
shown in a GUI window?

Thanks in advance,
Ido Yehieli.

Sep 23 '05 #1
9 1140
Id*********@gmail.com wrote:
i was wondering if anyone have written a GUI module that can
function as a replacment for stdin/stdout? ie. has a file like
interface, by which one could just assaign it to sys.stdout or
sys.stdin and have all your prints and raw_inputs and other such things
shown in a GUI window?


Xterm?
Sep 23 '05 #2
some thing platform independent will be preferable... (like a file like
interface for TK/Tcl)

Sep 24 '05 #3
Here's a suggestion for you:
Check out the comp.lang.py thread titled "Catching stderr output from
graphical apps" at
http://groups.google.com/group/comp....f604115b5e914e
I strongly suspect that the code discussed could probably be adapted to
handle sys.stdout instead of, or in addition to, output to sys.stderr.

It also sounds like it can be made platform independent.

Best,
-Martin

P.S. Please post your results back to the newsgroup -- thanks!
Ido.Yehi...@gmail.com wrote: hi,
i was wondering if anyone have written a GUI module that can
function as a replacment for stdin/stdout? ie. has a file like
interface, by which one could just assaign it to sys.stdout or
sys.stdin and have all your prints and raw_inputs and other such things
shown in a GUI window?

Thanks in advance,
Ido Yehieli.


Sep 25 '05 #4
Thanks martin,
I'll give it a shot as soon as i get back from work!

Sep 30 '05 #5
Ido,

I tried Bryan Olson's code [on Windows] from his last post to the
"Catching stderr output from graphical apps" thread <see
http://groups.google.com/group/comp.lang.python/msg/d61f1d5e02d84178>,
and it seemed to work for stdout as well as stderr output.

To enable its use with stdout, all I had to do was un-comment the last
line in Bryan's post, namely
# sys.stdout = ErrorPipe() and the any stdout output starting would appear in a separate window.

Since it's based on Tkinter, and from what Bryan said in his post, I
believe it's a fairly portable solution. [Nice work, Bryan!]

Best,
-Martin
Id*********@gmail.com wrote: Thanks martin,
I'll give it a shot as soon as i get back from work!


Oct 5 '05 #6
yes,
I've tried it aswell - nice work indeed!

now, maybe also get stdin to work from this TK window... ;-)

Oct 6 '05 #7
the source (and Bryan) doesn't say anything about further distribution
- and he did not provide a real email address.
Can I safely modify it and include it in the source distribution of my
program (it is open source licensed)? Would that be the polite thing to
do, i have no idea how to contact this guy?

Oct 6 '05 #8
In what way would you like to get "stdin to work"? In Bryan's post in
the Application(Frame).__init__() he binds some lambda functions to key
strokes which allow control-C copying of text in the window.

Seems like additonal application-specific things might be possible, but
then the code would no longer be generic. Interaction with the main
application would likely be tricky because each output window is
lanuched as a separate process when output is first sent to it.

As far a redistribution goes, I would think anything posted to the
public comp.lang.python usenet newgroup is unencumbered unless the
author indicates otherwise -- or at most covered by the same open
source license as Python.

-Martin
Id*********@gmail.com wrote:
yes,
I've tried it aswell - nice work indeed!

now, maybe also get stdin to work from this TK window... ;-)


Oct 6 '05 #9
Yes, i thought so myself.

Thanks,
Ido.

Oct 6 '05 #10

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

Similar topics

2
by: clusardi2k | last post by:
Hello, I'm trying to understand someone else code. The below compiles and works fine and dandy. #include <sys/types.h> #include "unistd.h" #include "stdio.h"
53
by: \(ProteanThread\) | last post by:
can "stdio.h" be OS specific at the kernal level or ? i know what I'm trying to ask here but not sure how to word it :-) -- Woodzy http://www.rtdos.com/forum
4
by: Chad | last post by:
What purpose does __THROW serve in stdio.h. For example, in I see stuff like the following in stdio.h: /* Generate a temporary filename. */ extern char *tmpnam (char *__s) __THROW;...
9
by: sunway | last post by:
i have written a small program, it turns out to be wrong, while(read()!=EOF){ read(); read(); read(); } so,when read==EOF,the next read() will read a -1, and the program will go infinitely.
11
by: talk | last post by:
hi,guy i have a question. are the functions in <stdio.h> system calls provided by operation system? if so, i want to know how C implements that we can call system calls by using the functions in...
2
by: david wolf | last post by:
My understanding is that cstdio basically is the same as stdio.h except the functions are in a namspace called std. However when I take a look at the content of the file cstdio, it has the...
4
by: SamG | last post by:
I have installed ubuntu 6.10 on my intel PC and when i try to write a small c code and compile it i get an error saying the is reference to stdio.h i checked /usr/include and /usr/local/include...
17
by: lak | last post by:
if i view stdio.h there are only symbolic constants. where is the definition of printf and scanf is available? i want to see the definition of printf and scanf and where it is stored?
1
by: samoukos | last post by:
Hello i had to do this project but at school they tell me that it will be faster using stdio insteed of fstream... Is that right??? if it is faster can anyone suggest how this code will be using...
6
by: hanaa | last post by:
Hello.. Is it okay to use functions such as setvbuf (that is defined in stdio.h) in a C++ program? I include stdio.h in the program and it works. Yet, I wonder if its okay.. stdio.h is a part of...
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: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
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,...

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.