A library providing some terminal features for IDLE's shell
Project description
idle-term
This library provides some terminal features for IDLE's shell. Some features are:
- "\b" and "\r" characters will be processed so progressbars which show information like progress percentage will finally work
- print_fancy function can be used to print with color, font and style
- clear function can be used to clear all outputs
Warning: The library isn't compatible with environments other than IDLE. Not even with the default shell of the system.
Installation
pip install idle-term
then you can import with
import idle_term
Escape Characters
Once you import the library, you don't have to do anything else and can immediately start using escape characters "\b", "\r", "\a" in your print and idle_term.print_fancy calls. These are the only escape characters supported. For things like colored output, use print_fancy.
Api Reference
function idle_term.print_fancy(*objects, sep = " ", end = "\n", **kwargs)
An alternative for the built in print function for printing with color, font and style. objects, sep and end parameters are for the same purpose as of the builtin print function.
kwargs will be passed to tag_config method of the tkinter.Text widget of IDLE's shell. You can find documentation about this method here. Parameters background and foreground accept a color value. You can find documentation about colors here. List of all predefined color names are here. A subset of those names can also be found in some 3rd party websites like this which also show the actual colors. If you want to use the font parameter, you must pass a tuple, tkinter.font.Font objects are not supported. You can get the list of all available font families by executing this code:
import tkinter.font
print(tkinter.font.families(tkinter.Tk()))
function idle_term.clear()
Clear the screen
function idle_term.paint_line(background = "", bgstipple = "")
Paint a line with the specified background color and stipple. Both parameters will be passed to tag_config method of the tkinter.Text widget of IDLE's shell. Read the second paragraph of the documentation of idle_term.print_fancy for more information about this method. If your program exits without printing anything else after calling this function, the painted line will be erased. In order to prevent this, you may print a space (" ") before exiting.
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 idle_term-1.0.0.post3.tar.gz.
File metadata
- Download URL: idle_term-1.0.0.post3.tar.gz
- Upload date:
- Size: 3.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f0e83254359f21d866405c7a99d0084e4d40bb822acfa770a55c758b454c8cf2
|
|
| MD5 |
ddbe61b8c8c3006f15afc1ffc3ad7876
|
|
| BLAKE2b-256 |
eef33d5fa7d269c0d210fdfe591d70b1114dfb2b25d6615a28e04628fcb72c7f
|
File details
Details for the file idle_term-1.0.0.post3-py2.py3-none-any.whl.
File metadata
- Download URL: idle_term-1.0.0.post3-py2.py3-none-any.whl
- Upload date:
- Size: 4.9 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ccc5ec4fa3ac756779940350e5d462b9b2b95b9ffb67f5f96023c74de250700b
|
|
| MD5 |
d98380f716263ae3a2c5241f21d03baf
|
|
| BLAKE2b-256 |
ec43e4115e321b77b1705b02af7d8371e056ae356d41bc97cf968bd5a37c0621
|