How do I force Python\'s print function to output to the screen?
This is not a duplicate of Disable output buffering - the linked question is attempting unbuffe
With Python 3.x the print() function has been extended:
print()
print(*objects, sep=' ', end='\n', file=sys.stdout, flush=False)
So, you can just do:
print("Visiting toilet", flush=True)
Python Docs Entry