I tried using QThread as well.. But the problem is, on the run method when i invoke the command prompt, it sends out the finished signal...  I want it to send out the finished signal only on closing the command prompt that is invoked earlier in my process.<br>
<br>guess some logic to be implement inside run() which monitors the command prompt / reports the status once the command prompt is closed.<br><br>I tried running loop inside the run() to keep the thread active but no help..<br>
<br>class RunMonitor(QThread):<br>    def __init__(self, parent = None):<br>        QThread.__init__(self)<br>        <br>    def run(self):<br>        print 'Invoking command prompt...............'<br>        subprocess.call(["start", "/DC:\\PerfLocal_PAL", "scripts_to_execute.bat"], shell=True)<br>
        while True:<br>            pass<br><br>def runscript(self):<br>        print 'Complete_file_Path inside Run script is : ' , self.complete_file_path<br>        file_operation.Generate_Bat_File(self.complete_file_path)<br>
        <br>        self.run_monitor_object = RunMonitor()<br>        self.run_monitor_object.start()<br> <br>        self.connect(self.run_monitor_object, SIGNAL("finished()"),self.threadstatus)<br>        <br>
<br><br><br><div class="gmail_quote">On Wed, May 11, 2011 at 9:25 PM, Wojtek Mamrak <span dir="ltr"><<a href="mailto:tacyt1007@gmail.com">tacyt1007@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div class="im">2011/5/11 Chris Angelico <<a href="mailto:rosuav@gmail.com">rosuav@gmail.com</a>>:<br>
</div><div class="im">> On Thu, May 12, 2011 at 1:16 AM, Wojtek Mamrak <<a href="mailto:tacyt1007@gmail.com">tacyt1007@gmail.com</a>> wrote:<br>
>> Is there any special reason you don't want to use QThread?<br>
>> <a href="http://www.riverbankcomputing.co.uk/static/Docs/PyQt4/html/qthread.html#details" target="_blank">http://www.riverbankcomputing.co.uk/static/Docs/PyQt4/html/qthread.html#details</a><br>
><br>
> Other than that QThread is part of QT and threading isn't, what are<br>
> the advantages of QThread? Is it possible (safe) to manipulate QT<br>
> objects - in this case, the button - from a thread other than the one<br>
> that created them? (If not, that would be a good reason for using<br>
> QThread, which will fire an event upon termination.)<br>
><br>
<br>
<br>
</div>QThread provides mechanism of signals and slots ("from" and "to" the<br>
thread), which are used across all pyQt. Unfortunately it is not<br>
possible to use any widget classes in the thread (direct quote from<br>
the docs). On the other hand signals can fire methods from the main<br>
thread (running the app'a main loop), so this is not a big deal.<br>
The signals are:<br>
- finished<br>
- started<br>
- terminated<br>
It is possible to block the thread, make it sleep, check whether the<br>
thread is running, and few others.<br>
<div><div></div><div class="h5">--<br>
<a href="http://mail.python.org/mailman/listinfo/python-list" target="_blank">http://mail.python.org/mailman/listinfo/python-list</a><br>
</div></div></blockquote></div><br><br clear="all"><br>-- <br>Vijay Swaminathan<br>