How to bring subprocess to the foreground?

dudeja.rajat at gmail.com dudeja.rajat at gmail.com
Sat Sep 6 15:22:47 EDT 2008


On Sat, Sep 6, 2008 at 6:53 PM, Paul Boddie <paul at boddie.org.uk> wrote:
> On 6 Sep, 17:58, dudeja.ra... at gmail.com wrote:
>>
>> I though of displayin an information message on the screen through
>> tkMessageBox while the subprocess is running, I did it using:
>>
>> try:
>>             testing = subprocess.Popen([batchFilePath], \
>>                                    shell = True)
>>
>>             retCode = testing.wait()
>
> Note that you wait for the process to finish here...
>
>>             tkMessageBox._show("Test Harness execution", \
>>                                icon = 'info', \
>>                                message="Testing %s in progress..." % libName)
>
> ...and that you show a message about the process running *after*
> waiting until it isn't running any more.
>
>>         except:
>>             tkMessageBox._show("Error", \
>>                                type='ok', icon='error', \
>>                                message="Error executing %s Test
>> Harness" % libName)
>>             return None
>>         else:
>>                 print retCode
>>
>> But the message is never displayed. Please suggest if there is
>> something wrong with this code
>
> I think you should first show your message, *then* wait for the
> process to finish.
>
> Paul
> --
> http://mail.python.org/mailman/listinfo/python-list
>

Such a silly mistake I'm committing.
Thanks a ton.

-- 
Regrads,
Rajat



More information about the Python-list mailing list