python应用-跑马灯

   

import os
import time
def main():
    str1='欢迎来到前锋学习Python'
    while True:
        os.system('cls')
        print(str1)
        time.sleep(0.5)
        str1=str1[1:]+str1[0]

if __name__ == '__main__':
    main()

  import os import time def main(): str1='欢迎来到前锋学习Python' while True: os.system('cls') print(str1) time.sleep(0.5) str1=str1[1:]+str1[0] if __name__ == '__main__': main()

原文地址:https://www.cnblogs.com/68xi/p/8546443.html