[PyQt] Need some assistance on QThread
swavijay at gmail.com
Wed May 11 07:07:21 BST 2011
I'm new bie to python and programming and would like to get some assistance
on the problem stated below.
I'm developing a GUI (using pyqt) to run some scripts (which were run on
command line earlier).
on the GUI I have a run button which calls a .bat file , which has the list
of scripts to execute. Once the run button is clicked, the run button is
disabled as it invokes a command prompt, calls a .bat file and when I close
the command prompt, I would like to re-enable the Run button.
Since I wanted to monitor the command prompt, I thought of invoking the
command prompt on a thread and monitor the thread. Correct me if I went
techinically incorrect here.
Run button on GUI: - Here I call the runscript ()
self.connect(self.run_button, SIGNAL('clicked()'), self.runscript)
file_operation.Generate_Bat_File(self.complete_file_path) # Generate
a bat file.
self.timer = QTimer() # invoke timer for starting and monitoring the
def __init__(self, parent=None):
print 'Invoking Command Prompt..........'
run_monitor_object = RunMonitor()
print 'Starting the thread...........'
print 'The Thread is still Alive .......'
print 'The Thread is not alive anymore......'
I doubt the following.
1.is this the correct way to monitor the thread? if not any help towards
this is appreciated.
2. Is this the correct way to invoke the command prompt in thread?
3. is it safe to assume that as long as the command prompt is alive, the
thread is active and when command prompt is closed, the thread is no more
Eagerly looking forward for some help....I googled enough but could not
arrive at a solution.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the PyQt