12This is a small module to replace the builtin print function with one that
15This is necessary as we mix a lot of C++ and python output and this means we
16need to flush the output frequently otherwise the order of lines is totally
19It overrides the function in the builtins module so this will propagate to
20everywhere. We do this in a extra module to be able to check the python version
27def flush_print(*args, **argk):
28 """print function which flushes by default"""
29 argk.setdefault(
"flush",
True)
30 builtins._print(*args, **argk)
34builtins._print =
print
36builtins.print = flush_print