A simple text animator.
Ths is a subclass of the Animation
abstract class and uses the Animator
class to display the animated text to the terminal; both classes are defined in the ascii-animator package.
pip install text_animator
Animate some text and display characters from left to right (default).
Code
from text_animator import TextAnimation
text = """This is the text
that we want to animate
let's see how well
this works ..."""
TextAnimation(text)()
Animate some text and display characters from right to left.
Code
from text_animator import TextAnimation, Effect
text = """This is the text
that we want to animate
let's see how well
this works ..."""
TextAnimation(text, effect=Effect.RIGHT_TO_LEFT)()
Animate some text and display characters at random.
Code
from text_animator import TextAnimation, Effect
text = """This is the text
that we want to animate
let's see how well
this works ..."""
TextAnimation(text, effect=Effect.RANDOM)()
Animate some text and display characters from left to right then surround text with a border. A border can be customized with top|bottom|left|right margins as well as top|bottom|left|right padding, default for all margins and padding is 1. Margins define the space outside the border, and padding define the space between the border and text.
Code
from text_animator import TextAnimation, Effect, Border
text = """This is the text
that we want to animate
let's see how well
this works ..."""
TextAnimation(text, border=Border(lm=0, tm=0, bm=0, tp=0, bp=0))()
Clone the repository and ensure the latest version of Docker is installed on your development server.
Build the Docker image:
docker image build \
-t \
text-animator:latest .
Run the Docker container:
docker container run \
--rm \
-it \
-v $PWD:/code \
text-animator:latest \
bash
Execute the build:
pyb -X