
csterry at mail
Sep 12, 2001, 11:26 AM
Post #1 of 1
(287 views)
Permalink
|
|
Generating a thread dump from python
|
|
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 com.foo.bar.class') logFile = open( logFileName ) # Read the output as it comes in. while 1 : s = outFile.readline() if not s : break logFile.write(s) logFile.flush() if self.timedOut.isSet() : logFile.close() outFile.close() raise SystemExit logfile.close() returnCode = outFile.close()
|