Guys I want to retrieve a process' affinity list by using subprocess.
try:
pid = 1500
x = subprocess.check_output(['taskset','-c','-p', str(pid)])
except Exception as inst:
print inst
However, this results in the following output:
pid 1500's correct affinity list: 0-3
How do I obtain the 0-3 value as a string directly? There can be only integers or a value like 0-3. Basically I'm trying to get what's after colon ':'.
Thanks in advance.