animatetools
Tools for creating text animations.
examples:
animatetools:
import animatetools
animatetools.animateframes(["frame1", "frame2", "frame3"], 2, 1, file=open("test.py", "w"))
# plays each frame in frames argument at 2 fps, repeating once.
prints the following to the file "test.py":
{"remove all the text from the terminal and move the cursor up to the top line"}
frame1
{"wait 0.5 seconds"}
{"remove all the text from the terminal and move the cursor up to the top line"}
frame2
{"wait 0.5 seconds"}
{"remove all the text from the terminal and move the cursor up to the top line"}
frame3
{"wait 0.5 seconds"}
{"remove all the text from the terminal and move the cursor up to the top line"}
frame1
{"wait 0.5 seconds"}
{"remove all the text from the terminal and move the cursor up to the top line"}
frame2
{"wait 0.5 seconds"}
{"remove all the text from the terminal and move the cursor up to the top line"}
frame3
{"wait 0.5 seconds"}
{"wait 0.5 seconds"}
and
{"remove all the text from the terminal and move the cursor up to the top line"}
don't actually get printed, they just represent what the program does.
typeout:
import animatetools
animatetools.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.
prints the following to the file "test.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"}
doesn't actually get printed, it just represents what the program does.
clearconsole
import animatetools, time
print("hi")
time.sleep(1)
clearconsole()
# print "hi", wait one second and then clear the console.
results in:
hi
{"wait 1 second"}
{"remove all the text from the terminal and move the cursor up to the top line"}
{"wait 1 seconds"}
and
{"remove all the text from the terminal and move the cursor up to the top line"}
don't actually get printed, they just represent what the program does.
Release files for animatetools 0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| animatetools-0.1.tar.gz | 3.2 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| animatetools-0.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 9.5 kB
Release files / animatetools-0.1.tar.gz
| Download URL | animatetools-0.1.tar.gz |
|---|---|
| Size | 3.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
84c5a07c23798902059d6cff64f04046a9099924b0ef1c3aea2ffa6f6d65afd0
|
|
BLAKE2b-256 checksum How to use checksums |
d698ce1fbc0cd941c1ebf61efa2c34a919cdc125f6b7cff402d7a3137f660081
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/47.1.0 requests-toolbelt/0.8.0 tqdm/4.48.0 CPython/3.8.5
|
Release files / animatetools-0.1-py3-none-any.whl
| Download URL | animatetools-0.1-py3-none-any.whl |
|---|---|
| Size | 6.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
482176b8c6581e8415bbd192ea76091e797eff632fb09264af54d85c77756e6e
|
|
BLAKE2b-256 checksum How to use checksums |
5bdda9588377cf84f1658b5c7c8b6a825d4223c6e6b99570e70ef70da95edab6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/47.1.0 requests-toolbelt/0.8.0 tqdm/4.48.0 CPython/3.8.5
|