[python] How to overwrite the previous print to stdout in python?