Replace console output in Python,sys.stdout.flush()