'''
Created on May 11, 2011

@author: viswamin
'''


from threading import  Thread

import subprocess



class MyThread(Thread):
    def __init__(self, parent = None):
        Thread.__init__(self)
        
    def run(self):
        print 'Invoking Command Promptt..............'
        #subprocess.call(["start", "/DC:\\PerfLocal_PAL", "scripts_to_execute.bat"], shell=True)
        subprocess.call(["start", "C:\\windows\\system32\\cmd.exe"], shell = True)
        
def main():
    mythread_object = MyThread()
    mythread_object.start()
    
    mythread_object.join()
    
    while True:
        if mythread_object.is_alive:
            print 'The Thread is still active.....'
        else:
            print 'The thread is not alive anymore......'

if __name__ == '__main__':
    main()