Welcome, guest | Sign In | My Account | Store | Cart

This is a DEMO to switch a *NIX terminal from text to _graphics_ mode on the fly.

The graphics characters are limited to lowercase 'a' through 'z' and this DEMO just prints a small subset to see what a fun, kids level, 8 channel Logic-Analyser/Digital-Oscilloscope might look like.

This may not work in every *NIX style terminal but does work on default terminals using bash on OSX 10.7.5, PCLinuxOS 2009 and Debian Linux 6.0.x.

Tested on Python 2.5.x to 3.3.2 on the above platforms... (It might work on earlier versions of Python but untested.)

Enjoy finding simple solutions to often very difficult problems...

Bazza...

Python, 24 lines
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# Graphics_DEMO.py
# Graphics characters DEMO.
print("\x1B[2J\x1B[HGraphics characters for an 8 channel Logic Analyser display DEMO.\n")
print("abcdefghijklmnopqrstuvwxyz")
# Enable _extended_ graphics characters using "\x1B(0".
print("\x1B(0abcdefghijklmnopqrstuvwxyz\n")
print("lqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq")
print("j                                                               ")
print("lqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqk                               ")
print("j                               mqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq")
print("lqqqqqqqqqqqqqqqk               lqqqqqqqqqqqqqqqk               ")
print("j               mqqqqqqqqqqqqqqqj               mqqqqqqqqqqqqqqq")
print("lqqqqqqqk       lqqqqqqqk       lqqqqqqqk       lqqqqqqqk       ")
print("j       mqqqqqqqj       mqqqqqqqj       mqqqqqqqj       mqqqqqqq")
print("lqqqk   lqqqk   lqqqk   lqqqk   lqqqk   lqqqk   lqqqk   lqqqk   ")
print("j   mqqqj   mqqqj   mqqqj   mqqqj   mqqqj   mqqqj   mqqqj   mqqq")
print("lqk lqk lqk lqk lqk lqk lqk lqk lqk lqk lqk lqk lqk lqk lqk lqk ")
print("j mqj mqj mqj mqj mqj mqj mqj mqj mqj mqj mqj mqj mqj mqj mqj mq")
print("x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x ")
print("vqvqvqvqvqvqvqvqvqvqvqvqvqvqvqvqvqvqvqvqvqvqvqvqvqvqvqvqvqvqvqvq")
print("xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx")
print("vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv")
# Disable _extended_ graphics characters using "\x1B(B".
print("\x1B(B\x1B[0mGraphics characters DEMO end.\n")

I am already working on a bash digital oscilloscope, it looks like Python may be just as easy if not easier.

Note the bottom two _traces_ are just for show here...

Enjoy...

3 comments

Barry Walker (author) 10 years, 3 months ago  # | flag

Graphics characters for an 8 channel Logic Analyser display DEMO.

abcdefghijklmnopqrstuvwxyz ▒␉␌␍␊°±␤␋┘┐┌└┼⎺⎻─⎼⎽├┤┴┬│≤≥

┌─────────────────────────────────────────────────────────────── ┘
┌───────────────────────────────┐
┘ └─────────────────────────────── ┌───────────────┐ ┌───────────────┐
┘ └───────────────┘ └─────────────── ┌───────┐ ┌───────┐ ┌───────┐ ┌───────┐
┘ └───────┘ └───────┘ └───────┘ └─────── ┌───┐ ┌───┐ ┌───┐ ┌───┐ ┌───┐ ┌───┐ ┌───┐ ┌───┐
┘ └───┘ └───┘ └───┘ └───┘ └───┘ └───┘ └───┘ └─── ┌─┐ ┌─┐ ┌─┐ ┌─┐ ┌─┐ ┌─┐ ┌─┐ ┌─┐ ┌─┐ ┌─┐ ┌─┐ ┌─┐ ┌─┐ ┌─┐ ┌─┐ ┌─┐ ┘ └─┘ └─┘ └─┘ └─┘ └─┘ └─┘ └─┘ └─┘ └─┘ └─┘ └─┘ └─┘ └─┘ └─┘ └─┘ └─ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─ ││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││ ┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴ Graphics characters DEMO end.

>>>
Barry Walker (author) 10 years, 3 months ago  # | flag

Sadly it did not display on here as expected. Oh well worth a try.

Barry Walker (author) 10 years, 2 months ago  # | flag

Well this snippet was voted down to 0 a couple of weeks ago and it really didn't bother me too much...

Then today, 27-02-2014, it was voted back up again...

To that person who voted it back to 1 again, many thanks from me; you know who you are.