ctypes – Beginner

I have the task of “wrapping” a c library into a python class. The docs are incredibly vague on this matter. It seems they expect only advanced python users would implement ctypes. Well i’m a beginner in python and need help. Some step by step help would be wonderful. So I have my c library. … Read more

What does (~0L) mean?

0L is a long integer value with all the bits set to zero – that’s generally the definition of 0. The ~ means to invert all the bits, which leaves you with a long integer with all the bits set to one. In two’s complement arithmetic (which is almost universal) a signed value with all bits set to one is -1. The reason for … Read more