This Python script allows you to generate ASCII art from text, customize the font, and save the result to a file. You can list available fonts, convert text to uppercase or lowercase, or use a random font.
- Run the command below to install the required python libraries:
python -m pip install -r requirements.txt
To generate ASCII art from a provided text:
python ascii_art_generator.py "Hello World"-
--font(optional): Specify the font to use for generating the ASCII art.Example:
python ascii_art_generator.py "Hello World" --font "slant"
-
--listor--list-fonts: List all available fonts.Example:
python ascii_art_generator.py --list
-
-ror--random: Generate ASCII art with a random font.Example:
python ascii_art_generator.py "Hello World" -r -
-uor--uppercase: Convert the input text to uppercase before generating the ASCII art.Example:
python ascii_art_generator.py "Hello World" -u -
-lor--lowercase: Convert the input text to lowercase before generating the ASCII art.Example:
python ascii_art_generator.py "Hello World" -l -
-sor--save: Save the generated ASCII art to a file. If no filename is provided, it will save the result with the text as the filename (sanitized).Example:
python ascii_art_generator.py "Hello World" -s output.txtIf no filename is provided, the file will be saved as
Hello_World.txt.
-
Generate ASCII art with the default font:
python ascii_art_generator.py "Hello World" -
Generate ASCII art using the "slant" font:
python ascii_art_generator.py "Hello World" --font "slant"
-
Generate ASCII art using a random font:
python ascii_art_generator.py "Hello World" -r -
Save the result to a file named
output.txt:python ascii_art_generator.py "Hello World" -s output.txt
This project is open-source and available under the MIT License. See the LICENSE file for more details.