シェルでやってる羽根回しをPythonでやってみたわ。
#!/usr/bin/env python import datetime import time class Hane(): def __init__(self): self.s = ["/","-","\\","|"] self.si = 0 def next(self): self.si = self.si + 1 if(self.si > 3): self.si = 0 return(str(self.s[self.si])) h = Hane() ttx = "" while 1: tx = datetime.datetime.now().strftime("%Y/%m/%d %H:%M:%S") if(tx != ttx): ttx = tx print("\r",flush=True,end="") print(tx+" "+h.next(),flush=True,end="") time.sleep(0.1)