cowsay-python

raw JSON →
1.0.2 verified Fri May 01 auth: no python

A very basic Python implementation of the classic cowsay program. Provides ASCII art cows and other characters that display messages. Current version 1.0.2, updated sporadically.

pip install cowsay-python
error ImportError: No module named 'cowsay'
cause The package is not installed or installed under a different name (e.g., `cowsay-python` vs `cowsay`).
fix
Run pip install cowsay-python. Then import as import cowsay.
error AttributeError: module 'cowsay' has no attribute 'cow'
cause Using an older version (<1.0) or confusing with the original `cowsay` package.
fix
Upgrade to latest: pip install --upgrade cowsay-python. Ensure you are using the correct package.
gotcha This package is not affiliated with the original `cowsay` package on PyPI (which is a wrapper around the system cowthink/cowsay). `cowsay-python` is a standalone Python implementation. Do not confuse them.
fix Use `import cowsay` for this package. The other package is imported as `cowsay.main`.
gotcha Only a limited set of characters (cow, trex, rabbit, etc.) are available. Not all classic cowsay animals are implemented.
fix Check the source code or docs for available functions.

Basic usage: call the animal function with a message.

import cowsay

# Draw a cow saying hello
cowsay.cow("Hello, Python!")

# Draw a trex
cowsay.trex("I'm a T-Rex!")