Advertisement
Guest User

Untitled

a guest
Apr 7th, 2015
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.37 KB | None | 0 0
  1. run_args = ["java", "-jar", "pathToJar.jar"]
  2.  
  3. ptimer = ProcessTimer(run_args)
  4.  
  5. try:
  6.     ptimer.execute()
  7.     #poll as often as possible; otherwise the subprocess might
  8.     # "sneak" in some extra memory usage while you aren't looking
  9.     while ptimer.poll():
  10.         time.sleep(.500)
  11. finally:
  12.     #make sure that we don't leave the process dangling
  13.     ptimer.close()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement