Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from subprocess import Popen, STDOUT, PIPE
- from time import sleep
- x = Popen('open -W ' + FileName, shell=True, stderr=STDOUT, stdout=PIPE, stdin=PIPE)
- while x.poll() == None:
- print('Text editor is still open')
- sleep(0.5)
- print('Text editor is now closed')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement