Advertisement
Guest User

Untitled

a guest
Oct 31st, 2013
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.27 KB | None | 0 0
  1. from subprocess import Popen, STDOUT, PIPE
  2. from time import sleep
  3.  
  4. x = Popen('open -W ' + FileName, shell=True, stderr=STDOUT, stdout=PIPE, stdin=PIPE)
  5. while x.poll() == None:
  6.     print('Text editor is still open')
  7.     sleep(0.5)
  8.  
  9. print('Text editor is now closed')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement