3 ms·
ctypes is like god-mode for Python... I like your hack too. I just play around with it from time to time, I believe the only "serious" thing I've done with it s
by Jach 15y ago
ctypes is like god-mode for Python... I like your hack too. I just play around with it from time to time, I believe the only "serious" thing I've done with it so far is making a Python interface around a C library I made.
I think I discovered the hack when I found out about the id() function, and hex(id(5)) looked suspiciously like a pointer value. (And http://docs.python.org/library/functions.html#id http://docs.python.org/library/functions.html#id confirms.) http://docs.python.org/library/ctypes.html http://docs.python.org/library/ctypes.html has usually been pretty useful. Apart from that, just play.