Easy ANSI control
Project description
PyANSI
PyANSI provides an easy way to use ANSI escape codes to control the colour and cursor of a terminal.
System Requirements
PyANSI is primarily intended for Unix-like operating systems but will run on any operating system which supports ANSI escape codes.
Note: Windows users may need to initialise the console using PyANSI.windows.init()
Install
Install using pip:
pip install PyANSI
Examples
Colour
Note: The colours and colors submodules are functionally identical but the colors submodule uses the American spelling of color instead of colour.
True Colour
from PyANSI import colours
colours.printHex("Hello, World!", foreHex="#00AEFF", backHex="#FF5500")
ANSI 256 Colour Mode
from PyANSI import colours
colours.print256("Hello, World!", foreColour=32, backColour=172)
Cursor Control
Show/hide the cursor
from PyANSI import cursor
cursor.hide()
cursor.show()
Move the cursor
from PyANSI import cursor
cursor.move.left(10)
cursor.move.right(10)
cursor.move.up(10)
cursor.move.right(10)
Jump to home
from PyANSI import cursor
cursor.home()
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file PyANSI-1.2.0.tar.gz.
File metadata
- Download URL: PyANSI-1.2.0.tar.gz
- Upload date:
- Size: 15.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.6.0 importlib_metadata/4.8.2 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.10.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
28b28a5d9dde2de924d218a93de6e85040d8fa7b35c1b6ebdfcd4116f6c8e567
|
|
| MD5 |
75e284db529637d450ca697a8076d689
|
|
| BLAKE2b-256 |
a8c3608fe9fdca2ccefbab9ad89caaa78a58eed4803cbf93c9c8546625439055
|
File details
Details for the file PyANSI-1.2.0-py3-none-any.whl.
File metadata
- Download URL: PyANSI-1.2.0-py3-none-any.whl
- Upload date:
- Size: 18.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.6.0 importlib_metadata/4.8.2 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.10.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cab097236e014c803b86ac347cc5d99b0627c097351a5c65573077c9dcbdb0d2
|
|
| MD5 |
ba4287acd1065cd7e344553ce5b086dc
|
|
| BLAKE2b-256 |
043910b270aef06ce729f420c41383d1023fdb7caea0c82b9ba1bf56ef672a07
|