用于创建文本动画的工具。
animatetools的Python项目详细描述
动画工具
用于创建文本动画的工具。在
示例:
动画工具:
importanimatetoolsanimatetools.animateframes(["frame1","frame2","frame3"],2,1,file=open("test.py","w"))# plays each frame in frames argument at 2 fps, repeating once.
将以下内容打印到文件中“测试.py“:
^{pr2}${"wait 0.5 seconds"}
和
{"remove all the text from the terminal and move the cursor up to the top line"}
实际上不是打印出来的,它们只是代表程序的功能。在
打印:
importanimatetoolsanimatetools.typeout("Print this out one character at a time","This too",5,sep=". ",end=". ",file=open("test.py","w"),flush=True)# prints out all the values ("Print this out one character at a time" and "This too") at 5 characters per second to the file "test.py",# seperating each value with ". " and ending in ". ". After each character it by default; flushes the stream so the text doesn't come in# chunks.
将以下内容打印到文件中“测试.py“:
P{"wait 0.2 seconds"}r{"wait 0.2 seconds"}i{"wait 0.2 seconds"}n{"wait 0.2 seconds"}t{"wait 0.2 seconds"}{"wait 0.2 seconds"}t{"wait 0.2 seconds"}h{"wait 0.2 seconds"}i{"wait 0.2 seconds"}s{"wait 0.2 seconds"}{"wait 0.2 seconds"}o{"wait 0.2 seconds"}u{"wait 0.2 seconds"}t{"wait 0.2 seconds"}{"wait 0.2 seconds"}o{"wait 0.2 seconds"}n{"wait 0.2 seconds"}e{"wait 0.2 seconds"}{"wait 0.2 seconds"}c{"wait 0.2 seconds"}h{"wait 0.2 seconds"}a{"wait 0.2 seconds"}r{"wait 0.2 seconds"}a{"wait 0.2 seconds"}c{"wait 0.2 seconds"}t{"wait 0.2 seconds"}e{"wait 0.2 seconds"}r{"wait 0.2 seconds"}{"wait 0.2 seconds"}a{"wait 0.2 seconds"}t{"wait 0.2 seconds"}{"wait 0.2 seconds"}a{"wait 0.2 seconds"}{"wait 0.2 seconds"}t{"wait 0.2 seconds"}i{"wait 0.2 seconds"}m{"wait 0.2 seconds"}e{"wait 0.2 seconds"}.{"wait 0.2 seconds"}{"wait 0.2 seconds"}T{"wait 0.2 seconds"}h{"wait 0.2 seconds"}i{"wait 0.2 seconds"}s{"wait 0.2 seconds"}{"wait 0.2 seconds"}{"wait 0.2 seconds"}t{"wait 0.2 seconds"}o{"wait 0.2 seconds"}o{"wait 0.2 seconds"}.{"wait 0.2 seconds"}
{"wait 0.2 seconds"}
实际上不会打印出来,它只是代表程序的功能。在
clearconsole
importanimatetools,timeprint("hi")time.sleep(1)clearconsole()# print "hi", wait one second and then clear the console.
结果:
hi{"wait 1 second"}{"remove all the text from the terminal and move the cursor up to the top line"}
{"wait 1 seconds"}
和
{"remove all the text from the terminal and move the cursor up to the top line"}
实际上不是打印出来的,它们只是代表程序的功能。在
- 项目
标签: