rallway.py

#!/usr/local/bin/python3
# -*- conding : utf-8 -*-
"""
@Time         :  19-3-16 下午12:30
@Author       :  xq
@Software     :  PyCharm
@File         :  rallway.py
@Description   :
"""

import time
n=0
print('#'*20,end= '')

while True:
    time.sleep(0.2)
    print('
%s@%s' %('33[32;1m#33[0m'*n,'#'*(19-n)),end='')        
    n +=1
    if n==20:
        n=0

  # 表示回车不换行 每执行一次就会覆盖前面的操作 比如abc 执行 就会覆盖a 简单来说 就是到第一个

原文地址:https://www.cnblogs.com/lsgo/p/10546781.html