<p>Is it possible to programmatically either via the win32API (python) or via a command line option set the processor affinity for a process?</p>

In C/C++ you can use
SetThreadIdealProcessor()
.  I have no idea if this is accessible in python.
```
```
DWORD processorId = 0;
SetThreadIdealProcessor(GetCurrentThread(),processorId);
```
```