[pygtk] Hi, all! I'm new to the list. How can I create please a frontend for a TUI command?

Néstor Amigo Cairo nestorac at gmail.com
Tue Oct 28 18:56:46 WST 2008


Ok! I have tested this, and it only works at the end of the execution
of the command, I attach the program to show this, please, execute
with:
# ./textview-basic.py

The thing is that output is shown when command has finished executing,
not while executing, so no progress is shown.

This is a heavily modified version of an example. When in the
application, please, press "Format" That executes the script
"prueba.sh" (which means test.sh in Spanish). It is safe, you can
check it, it doesn't format anything, yet!!

Make both files executable, of course.

Thanks!!

2008/10/27 A.T.Hofkamp <a.t.hofkamp at tue.nl>:
> Néstor Amigo Cairo wrote:
>>
>> Hi!
>>
>> I'm working in a GUI application as a frontend for some commands to
>> copy some files into a Compact Flash. My question is: how can I
>> execute the command from the GUI and show the output on a TextView
>> inside the GUI application, line by line?? (the command is 'badblocks
>
> In short:
>
> launch the command, and feed the output handle into
>
> gobject.io_add_watch()
>
> you will get an event when something interesting (like arrival of new text)
> happens.
>
> In the handler, read the data, and add it to your textview widget.
>
>
> Albert
>



-- 
Néstor
+34 687 96 74 81
nestorac at gmail.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: textview-basic.py
Type: text/x-python
Size: 4450 bytes
Desc: not available
Url : http://www.daa.com.au/pipermail/pygtk/attachments/20081028/af319ef1/attachment.py 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: prueba.sh
Type: application/x-sh
Size: 77 bytes
Desc: not available
Url : http://www.daa.com.au/pipermail/pygtk/attachments/20081028/af319ef1/attachment.sh 


More information about the pygtk mailing list