Advertisement
Senethril

python not killing 2 ahk script waited for a program

Aug 4th, 2015
260
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Perl 6 1.08 KB | None | 0 0
  1. #! /usr/bin/env python
  2. # -*- coding: utf-8 -*-
  3. from subprocess import Popen
  4. from os import system
  5. ahkpath="C:/Users/Colorado/Documents/AHK/apps/poe/disableWheelNotWithCtrl.AHK"
  6. ahkpath2="C:/Users/Colorado/Documents/AHK/apps/poe/SetPillarsInterface.AHK"
  7. poepath="D:/steam/SteamApps/common/Pillars of Eternity/PillarsOfEternity.exe"
  8.  
  9. tokill=Popen([ahkpath], shell=True,stdin=None, stdout=None, stderr=None, close_fds=True)
  10. tokill2=Popen([ahkpath2], shell=True,stdin=None, stdout=None, stderr=None, close_fds=True)
  11. poe=Popen([poepath], shell=True,stdin=None, stdout=None, stderr=None, close_fds=True)
  12. poe.wait()
  13. tokill.terminate()
  14. tokill2.terminate()
  15. tokill.kill()
  16. tokill2.kill()
  17. #Popen(['taskkill /F /T /PID ' + str(tokill.pid)], shell=True,stdin=None, stdout=None, stderr=None, close_fds=True)
  18. #Popen(['taskkill /F /T /PID ' + str(tokill2.pid)], shell=True,stdin=None, stdout=None, stderr=None, close_fds=True)
  19. system('taskkill /f /t /pid ' + str(tokill.pid))
  20. system('taskkill /f /t /pid ' + str(tokill2.pid))
  21. print str(tokill.pid)
  22. print str(tokill2.pid)
  23. #raw_input("kill pleasel ol")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement