As a continuation from my previous question on building interactive option menus in pexpect, print statements within an interact input filter do not get sent to stdout until aft
Don't really know why print()
'ed data is not automatically flushed when interacting with the spawned child but you can flush it explicitly so it would show up realtime:
print('something')
sys.stdout.flush()
or just use (only for python3)
# .raw is not buffered
sys.stdout.buffer.raw.write('something')