https://blog.csdn.net/miner_k/article/details/76946045
import sys
每一个 print 语句后面跟上:
sys.stdout.flush()