daily pastebin goal
39%
SHARE
TWEET

leaguescript.py

a guest Aug 1st, 2012 392 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #(C) Kim Lindgren, 2012. Feel free to modify to your hearts content! I can not guarantee that this will work perfectly for everyone
  2.  
  3. #!/usr/bin/python
  4.  
  5. from subprocess import Popen, PIPE, STDOUT
  6.  
  7. command = 'ps ax | grep League'
  8. process = Popen(command, shell=True, stdin=PIPE, stdout=PIPE, stderr=PIPE, close_fds=True)
  9. output = process.stdout.read()
  10.  
  11. splitout = output.splitlines()
  12.  
  13. for lines in splitout:
  14.         for words in lines.split(' '):
  15.                 for word in words.split('/'):
  16.                         #print(word)
  17.                        
  18.                         if word == 'LolClient.exe':
  19.                                 pid = lines.split(' ')[0]
  20.                                 print('\nfound it: ' + pid)
  21.                                
  22.                                 taskset = Popen('taskset -p 1 ' + pid, shell=True, stdin=PIPE, stdout=PIPE, stderr=PIPE, close_fds=True)
  23.                                
  24.                                 out = taskset.stdout.read()
  25.                                
  26.                                 for line in out.splitlines():
  27.                                         print('-----> ' + line)
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top