Skip to main content

Toolkit which overloads 'print(…)' and 'input()' to redirect them to a web page.

Project description

term2web: terminal in a web page (Python version)

Run on About online demonstrations

license: MIT Version

Notice française :

This library is like termcolor, but with all the text formatting possibilities of CSS.

Install (pip install term2web), import (from term2web import *) on the top of your program, and all print(…) and input(…) will be redirected to a web page.

You can also launch:

  • git clone,
  • cd term2web-python,
  • python3 (or directly python3 or python3

Online demonstration:

There are three other functions available.

set_property(name,value) applies the CSS property of name name and value value.


set_property("font-style", "italic")

set_properties(properties) applies the CSS properties stored in properties which is a dictionary whose keys are property names, and values the corresponding property values.


    "text-decoration-line": "line-through",
    "text-decoration-style": "wavy",
    "text-decoration-color": "red"

reset_properties() removes all the CSS properties set by above functions. is an example with calls to print(…) and input(…), but without CSS formatting. Comment out the import * from term2web for the program to run in the usual way in a terminal. shows how CSS rules can be used to format the displayed text.

You can still use the default print(…) and input(…) after an import builtins with builtins.print(…) and builtins.input(…).

Unlike other programs based on the Atlas toolkit, on which this library is based, it is not possible to simultaneously launch two or more instances of a program based on the term2web library. This is intentional, in order to keep this library simple to use.

Project details

Download files

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

Files for term2web, version 0.0.4
Filename, size File type Python version Upload date Hashes
Filename, size term2web-0.0.4-py3-none-any.whl (6.4 kB) File type Wheel Python version py3 Upload date Hashes View
Filename, size term2web-0.0.4.tar.gz (5.4 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page