TypeFX module


Contents:

Definition

What is TypeFX?

First of all, it is a Python module, not a standalone project. Therefore, it most probably is useful for developers, only. The module can be integrated in software projects for certain purposes.



Details

Further information about the module.

Python poweredThe TypeFX module is very simple and project as well as platform independent. Its name stands for "type effects".

It allows printing a string with a user-defined delay after each character. The delay can either be static (prints the output "machine like") or dynamic (prints the output sort of "typewriter like").



Shell alternative

Shell code for a similar effect as the Python module provides.

In case the "machine like" type effect should be used in a shell script, it would be quite inconvenient to run this Python module every time when printing a text on the shell.

However, such an effect can also be produced using shell commands. Below you can find a code snippet containing a shell function for that purpose.


The following code was developed on the Bash shell, which is the default shell on many Unix-like systems. It may also work with other shells, however, there is no guarantee for that.

#!/bin/bash

typefx() {
   
delay=$1
   
string=$2

   
for char in $(seq 0 $(expr length "${string}")); do
        echo
-n "${string:$char:1}"
        sleep $delay
    done
   
echo
}

typefx 0.01 "This is a simple text printed on the shell."


Download

Download the project.

GitHub logoDownloads and further information can be found on GitHub.