process_linger.py 286 B

12345678910111213141516
  1. """Write to a file descriptor and then close it, waiting a few seconds before
  2. quitting. This serves to make sure SIGCHLD is actually being noticed.
  3. """
  4. import os, sys, time
  5. print("here is some text")
  6. time.sleep(1)
  7. print("goodbye")
  8. os.close(1)
  9. os.close(2)
  10. time.sleep(2)
  11. sys.exit(0)