在终端中建立一个python程序,配合cowsay、lolcat、figlet等命令实现循环报时效果
import subprocess
import datetime
import time
while True:
now = datetime.datetime.now()
current_time = now.strftime("%H:%M:%S")
subprocess.call(["cowsay", "-f", "turtle", current_time])
subprocess.call(["lolcat"])
subprocess.call(["figlet", current_time])
time.sleep(3)
```python
import time
while True:
current_time = time.strftime("%H:%M:%S", time.localtime())
print(f"\r{current_time}", end="", flush=True)
time.sleep(1)
cowsay("-std=提示-command=mer有变化(T={})请保存退出,:O0".format(current_time))
```
如果有用请采用该回答