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

pygtk and long running process

Hi,

I have a command line app that can take up to 20 minutes to complete and
every minute or so updates it's status (spits it out to console). I am
writing a front end for this app in python/gtk and was wondering what
command I use to a) invoke the command and b) how to capture it's out put
and for instance update a text box.

Regards,

Rob
Jul 19 '05 #1
3 1347
Robert wrote:
I have a command line app that can take up to 20 minutes to complete and
every minute or so updates it's status (spits it out to console). I am
writing a front end for this app in python/gtk and was wondering what
command I use to a) invoke the command and b) how to capture it's out put
and for instance update a text box.


os.popen() will probably do what you want.

e.g.:

import os

some_external_command = "ls"
prog_output = os.popen(some_external_command)
for status_line in prog_output:
print status_line

-Dan
Jul 19 '05 #2
Daniel Cer wrote:
Robert wrote:
I have a command line app that can take up to 20 minutes to complete and
every minute or so updates it's status (spits it out to console). I am
writing a front end for this app in python/gtk and was wondering what
command I use to a) invoke the command and b) how to capture it's out put
and for instance update a text box.

os.popen() will probably do what you want.

e.g.:


(....)

As for the latter part of (b)....

I don't know much about pygtk, but I imagine you should be able to put
the code that monitors the external program in a thread, and then
whenever you get some new status information update the text box.

-Dan
Jul 19 '05 #3
On Sun, 24 Apr 2005 19:46:52 -0600, Daniel Cer wrote:
Daniel Cer wrote:
Robert wrote:
I have a command line app that can take up to 20 minutes to complete and
every minute or so updates it's status (spits it out to console). I am
writing a front end for this app in python/gtk and was wondering what
command I use to a) invoke the command and b) how to capture it's out put
and for instance update a text box.

os.popen() will probably do what you want.

e.g.:


(....)

As for the latter part of (b)....

I don't know much about pygtk, but I imagine you should be able to put
the code that monitors the external program in a thread, and then
whenever you get some new status information update the text box.

-Dan


Thanks for your help

Jul 19 '05 #4

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

Similar topics

0
by: zinc | last post by:
Hi Pythoneers, Im interested in trying some gui programming with the GTK2 toolkit. I found this brief article,(http://www.linuxjournal.com/article.php?sid=6586), that speaks about utilising...
6
by: Mark Mitchell | last post by:
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 I have a program written in python that tells me it requires PyGTK, so I DLed, ./configure, make, make install and the process seems to go ok. Some...
22
by: dcrespo | last post by:
Hi all... I think wxPython is much better than PyGTK. First of all, PyGTK needs the GTK runtime installed, whereas wxPython is entirely Python's modules, so It facilitates the apps'...
25
by: TPJ | last post by:
GUI's etc: PyGtk on Windows "(...) So if someone develops mainly for X and just wants to make sure that it is not impossible to run on Windows, you can use PyGTK. (...)", July 2nd, 1999 pyGTK...
1
by: Anonieko | last post by:
Query: How to display progress bar for long running page Answer: Yet another solution. REFERENCE: http://www.eggheadcafe.com/articles/20050108.asp My only regret is that when click the...
2
by: Tim N. van der Leeuw | last post by:
I tried to create a windows executable of a pygtk program. My first attempt worked, kinda, except that no themes were applied and no readable fonts were found by pango; so all letters where just...
6
by: seb | last post by:
Hi, I am using pygtk for the first times. I am wondering what would be the best "pattern" to interface pygtk with a thread. The thread is collecting informations (over the network for...
1
by: krishnakant Mane | last post by:
hello, I will be writing some code in PyGTK to run on linux. but I want to know if there are any installers or distutils available for PyGTK on windows? I have heard that installing gimp or even...
0
by: Michael Palmer | last post by:
On Sep 16, 12:30 pm, binaryjesus <coolman.gu...@gmail.comwrote: I haven't tried it myself, but I came across a blog post the other day that describes a way of building windows installers for...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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...
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,...

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.