A Python Library for Command Line Interface (CLI) Development
Terminalia provides a collection of useful functions for working with terminals, including:
Terminal.set_title(title: str)
: sets the title of the console window to the given title.Terminal.clear()
: clears the terminal screen.Terminal.hide_cursor()
: hides the cursor in the console.Terminal.show_cursor()
: shows the cursor in the console.Terminal.translate(text: str)
: translates the given text from English to another language.Terminal.write(text: str, interval: float = 0.01, hide_cursor: bool = True)
: simulates typing out the given text with a specified interval between characters.pip3 install Terminalia
To use this package, simply import it as follows:
from Terminalia import Terminal, Color # importing color is optional
Sets the title of the terminal window.
from Terminalia import Terminal
Terminal.Title("This is a test title")
Args:
Clears the terminal screen.
from Terminalia import Terminal
Terminal.Clear()
Hides the cursor on the terminal.
from Terminalia import Terminal
Terminal.Hide_Cursor()
Displays the cursor on the terminal.
from Terminalia import Terminal
Terminal.Show_Cursor()
Translate text from one language to another. Auto detects the specified text’s language as well as the users language.
from Terminalia import Terminal
print(Terminal.Translate("Ceci est un exemple de texte"))
Args:
Returns:
Writes the specified text to the console, one character at a time, with an optional delay between characters.
from Terminalia import Terminal
print(Terminal.Write(text="This is an example text", interval=0.5, hide_cursor=True))
Args:
Returns:
Colors text with the specified color.
from Terminalia import Color
print(f"{Color.BLUE}Hello, world!{Color.RESET}")
Colors