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
I found that printing to the screen gave a weird offset based on what had previously been printed out by the spawned process and that the spawned processes next output was also offset a weird amount. What I ended up doing was:
sys.stdout.write(f'\n\rsomething\r\n')
sys.stdout.flush()
This prints my something
at the beginning of a new line, then starts the spawned processes output at the beginning of the next line.