Generating a thread dump from python

cster csterry at
Wed Sep 12 20:26:03 CEST 2001

I am using a python script to run a java command.
When the java command hangs, I would like to issue a 'kill -3' to the java.
Anybody know how this can be done?

The following is happening in a thread in my python script:
--------- snip -----------
def run( self ) :
  outFile = os.popen('java')

  logFile = open(  logFileName )

  # Read the output as it comes in.
  while 1 :
    s = outFile.readline()
    if not s : break

    if self.timedOut.isSet() :
        raise SystemExit

returnCode    = outFile.close()

More information about the Python-list mailing list