- 论坛徽章:
- 0
|
小弟不才改进了一下.
- #! /usr/bin/python
- import time, sys
- def usage():
- print "Usage: %s [ rotor | baloon | square | dash | rotor2 ]" % (sys.argv[0],)
- if len(sys.argv) == 1:
- usage()
- sys.exit (1)
- rotor = "|/-\\|/-\\"
- baloon = " .oO@@Oo. "
- square = " _uUOOUu_ "
- dash = "_-=##=-_ "
- rotor2 = "3WEM"
- w = sys.stdout.write; f = sys.stdout.flush
- def main(them):
- status = 0; n = len(them); n2 = 3*n
- while True:
- w(them[status % n]); f()
- time.sleep(0.1)
- status += 1
- if not (status%n2): w('\b.')
- else: w('\b')
- if __name__ == '__main__':
- main(sys.argv[1])
复制代码
刚开始学这个.以后各位请各位大哥不吝赐教! |
|