printf will generally work in C extensions (although, as others have said, it goes to STDOUT which is not necessarily the same as Python sys.stdout) Try explicitly flushing the buffer with fflush(stdout)