Name | idle-term JSON |
Version |
1.0.0.post1
JSON |
| download |
home_page | None |
Summary | A library providing some terminal features for IDLE's shell |
upload_time | 2025-02-06 00:52:33 |
maintainer | None |
docs_url | None |
author | None |
requires_python | None |
license | None |
keywords |
idle
progressbar
terminal
|
VCS |
 |
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
# 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
```python
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](https://docs.python.org/3.13/library/functions.html#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](https://tkdocs.com/shipman/text-methods.html).
Parameters _background_ and _foreground_ accept a color value. You can find documentation about colors [here](https://tkdocs.com/shipman/colors.html). List of all predefined color names are [here](https://www.tcl-lang.org/man/tcl/TkCmd/colors.htm). A subset of those names can also be found in some 3rd party websites like [this](https://cs111.wellesley.edu/archive/cs111_fall14/public_html/labs/lab12/tkintercolor.html) 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:
```python
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.
Raw data
{
"_id": null,
"home_page": null,
"name": "idle-term",
"maintainer": null,
"docs_url": null,
"requires_python": null,
"maintainer_email": null,
"keywords": "idle, progressbar, terminal",
"author": null,
"author_email": null,
"download_url": "https://files.pythonhosted.org/packages/a1/2f/f6784d4e0f7033532708a8a2d04dec1f791886ff382e60277c2595896e9f/idle_term-1.0.0.post1.tar.gz",
"platform": null,
"description": "# idle-term\nThis library provides some terminal features for IDLE's shell.\nSome features are:\n- \"\\b\" and \"\\r\" characters will be processed so progressbars which show information like progress percentage will finally work\n- _print_fancy_ function can be used to print with color, font and style\n- _clear_ function can be used to clear all outputs\n \nWarning: The library isn't compatible with environments other than IDLE. Not even with the default shell of the system.\n\n# Installation\n```pip install idle-term```\n\nthen you can import with\n```python\nimport idle_term\n```\n\n# Escape Characters\nOnce 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_.\n\n# Api Reference\n_function_ idle_term.**print_fancy**(*objects, sep = \" \", end = \"\\n\", **kwargs)\n\nAn alternative for the built in print function for printing with color, font and style.\n_objects_, _sep_ and _end_ parameters are for the same purpose as of the builtin [print](https://docs.python.org/3.13/library/functions.html#print) function.\n\n_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](https://tkdocs.com/shipman/text-methods.html).\nParameters _background_ and _foreground_ accept a color value. You can find documentation about colors [here](https://tkdocs.com/shipman/colors.html). List of all predefined color names are [here](https://www.tcl-lang.org/man/tcl/TkCmd/colors.htm). A subset of those names can also be found in some 3rd party websites like [this](https://cs111.wellesley.edu/archive/cs111_fall14/public_html/labs/lab12/tkintercolor.html) 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:\n```python\nimport tkinter.font\nprint(tkinter.font.families(tkinter.Tk()))\n```\n\n_function_ idle_term.**clear**()\n\nClear the screen\n\n_function_ idle_term.**paint_line**(background = \"\", bgstipple = \"\")\n\nPaint 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.\nIf 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.\n",
"bugtrack_url": null,
"license": null,
"summary": "A library providing some terminal features for IDLE's shell",
"version": "1.0.0.post1",
"project_urls": {
"Homepage": "https://github.com/pyhacks/idle-term"
},
"split_keywords": [
"idle",
" progressbar",
" terminal"
],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "1fe72d0cae661eac9de920bae0a9f239eff293a9a0dfe8764fc255d17e599b22",
"md5": "8762c7cf11fe72cd1f11cbae51652ed2",
"sha256": "1d809bc0430f9e513ddf476d86af4aa7e39d565ca1346167e231414b39b992e6"
},
"downloads": -1,
"filename": "idle_term-1.0.0.post1-py2.py3-none-any.whl",
"has_sig": false,
"md5_digest": "8762c7cf11fe72cd1f11cbae51652ed2",
"packagetype": "bdist_wheel",
"python_version": "py2.py3",
"requires_python": null,
"size": 4901,
"upload_time": "2025-02-06T00:52:30",
"upload_time_iso_8601": "2025-02-06T00:52:30.728043Z",
"url": "https://files.pythonhosted.org/packages/1f/e7/2d0cae661eac9de920bae0a9f239eff293a9a0dfe8764fc255d17e599b22/idle_term-1.0.0.post1-py2.py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "a12ff6784d4e0f7033532708a8a2d04dec1f791886ff382e60277c2595896e9f",
"md5": "42ebbc10b011959eba28089f623394bc",
"sha256": "a8e21a96858b663591e804d40f4b91d9c9f1682766ce953e1433a2a6d4c59230"
},
"downloads": -1,
"filename": "idle_term-1.0.0.post1.tar.gz",
"has_sig": false,
"md5_digest": "42ebbc10b011959eba28089f623394bc",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 3884,
"upload_time": "2025-02-06T00:52:33",
"upload_time_iso_8601": "2025-02-06T00:52:33.817455Z",
"url": "https://files.pythonhosted.org/packages/a1/2f/f6784d4e0f7033532708a8a2d04dec1f791886ff382e60277c2595896e9f/idle_term-1.0.0.post1.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-02-06 00:52:33",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "pyhacks",
"github_project": "idle-term",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"lcname": "idle-term"
}