Switch idling process from external C# program to use of ctypes