Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #(C) Kim Lindgren, 2012. Feel free to modify to your hearts content! I can not guarantee that this will work perfectly for everyone
- #!/usr/bin/python
- from subprocess import Popen, PIPE, STDOUT
- command = 'ps ax | grep League'
- process = Popen(command, shell=True, stdin=PIPE, stdout=PIPE, stderr=PIPE, close_fds=True)
- output = process.stdout.read()
- splitout = output.splitlines()
- for lines in splitout:
- for words in lines.split(' '):
- for word in words.split('/'):
- #print(word)
- if word == 'LolClient.exe':
- pid = lines.split(' ')[0]
- print('\nfound it: ' + pid)
- taskset = Popen('taskset -p 1 ' + pid, shell=True, stdin=PIPE, stdout=PIPE, stderr=PIPE, close_fds=True)
- out = taskset.stdout.read()
- for line in out.splitlines():
- print('-----> ' + line)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement