У меня смешная проблема с ctypes; хотя он, кажется, работает в обычных скриптах на python, когда я использую его в интерпретаторе с printf (), он печатает длину строки после самой строки. Демо:
Python 2.6.5 (r265:79063, Apr 16 2010, 13:09:56)
[GCC 4.4.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> from ctypes import *
>>> libc = CDLL("libc.so.6")
>>> libc.printf("Test")
Test4
>>> int = 55
>>> libc.printf("Test %d", int)
Test 557
>>> int = c_int(55)
>>> libc.printf("Test %d", int)
Test 557
Кто-нибудь знает, почему это происходит?