Skip to main content

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

idle_term-1.0.0.post3.tar.gz (3.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

idle_term-1.0.0.post3-py2.py3-none-any.whl (4.9 kB view details)

Uploaded Python 2Python 3

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

Hashes for idle_term-1.0.0.post3.tar.gz
Algorithm Hash digest
SHA256 f0e83254359f21d866405c7a99d0084e4d40bb822acfa770a55c758b454c8cf2
MD5 ddbe61b8c8c3006f15afc1ffc3ad7876
BLAKE2b-256 eef33d5fa7d269c0d210fdfe591d70b1114dfb2b25d6615a28e04628fcb72c7f

See more details on using hashes here.

File details

Details for the file idle_term-1.0.0.post3-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for idle_term-1.0.0.post3-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 ccc5ec4fa3ac756779940350e5d462b9b2b95b9ffb67f5f96023c74de250700b
MD5 d98380f716263ae3a2c5241f21d03baf
BLAKE2b-256 ec43e4115e321b77b1705b02af7d8371e056ae356d41bc97cf968bd5a37c0621

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page