Skip to main content

A python module to update the console without flashing.

Project description

Have you ever tried updating the console with text that changes multiple times a second? Remember how when you tried clearing the console with os.system calls it would make the console flash and make the text unreadable? I wrote this python module to prevent exactly that. Introducing...

ConsoleDraw

A python module to update the console without flashing.

Installation

The consoledraw module can be installed using pip.

pip install consoledraw

If that doesn't work, try this instead.

pip install git+https://github.com/Matthias1590/ConsoleDraw.git

Or, if you want to, you can clone the repo and run the following commands.

python3 setup.py build
python3 setup.py install

Demo

example.py:

from consoledraw import Console
from datetime import datetime
from time import sleep

console = Console()

format = """
    ╔══════════╗
{}
    ╚══════════╝
"""

while True:
    with console:
        console.print(format.format(datetime.strftime(datetime.now(), "%H:%M:%S")))

    sleep(0.5)

Demo GIF

with console:    
    console.print("Hello, world!")
    console.print("Another message!")

# is the same as

console.clear()

console.print("Hello, world!")
console.print("Another message!")

console.update()

Downloads

Downloads Downloads Downloads

Supported Operating Systems

The consoledraw module is supported on Windows, Linux and Mac.

Project details


Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

consoledraw-2.4.2-py3.8.egg (7.1 kB view hashes)

Uploaded Source

Supported by

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