Advertisement
Guest User

Untitled

a guest
Sep 30th, 2016
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.52 KB | None | 0 0
  1. def check_output(file, interval_time, logfile_path):
  2. import os
  3. import time
  4.  
  5. status = os.path.isfile(file)
  6.  
  7.  
  8. while status is not True:
  9. f_log = open(logfile_path, 'a')
  10. f_log.write(time.asctime() + '\t' + 'Still running\n')
  11. f_log.close()
  12. time.sleep(interval_time)
  13. status = os.path.isfile(file)
  14.  
  15.  
  16. # What should be done after the file appears?
  17. # This goes here:
  18.  
  19.  
  20. f_log = open(logfile_path, 'a')
  21. f_log.write(time.asctime() + '\t' + 'FINISHED\n')
  22. f_log.close()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement