标签:
在http://usingpython.com/dl/animBanner.py上看到的,挺好玩的,做了一点小改动。
#TO SHOW STRING "I LIKE YOU!" IN THE WINDOWS CONSOLE import os import time #windows console width width = 79 # printedMessage = ["***** * ***** * * ***** * * ***** * * *", " * * * * * * * * * * * * *", " * * * * * * * * * * * *", " * * * ** ***** * * * * * *", " * * * * * * * * * * * *", " * * * * * * * * * * * ", "***** ***** ***** * * ***** * ***** ***** *",] # offset = width # while True: os.system("cls") for row in range(7): print(" " * offset + printedMessage[row][max(0,offset*-1):width - offset]) # offset -= 1 if offset <= len(printedMessage[0]) * -1: offset = width # time.sleep(0.05) #
标签:
原文地址:http://www.cnblogs.com/zhanchao/p/5768792.html