Skip to main content

A Tool for multiprocess screen manipulation

Project description

Info

mpscreen is a tool for screen manipulation. It allows for multiple consoles, dividing screen, custom colors and supports multiprocess environments. It uses ASCI escape codes so will work on linux only. If your console is set up for 256 colors

Usage

In order to use this first setup screen server and build elements. Once build you must start the server.

# build screen server
ss = mpscreen() 

# build screen elements
l1 = ss.buildLine(top=1, pattern=[" Main Pattern : ", Vstr("v:<13")], background=52, color=207) # adding custom elements
l2 = ss.buildLine(top=2, pattern=[" Main Pattern  ", Vint("count:5"), ' / ', Vint("total:5")], background=55, color=207)
upperConsole = ss.buildBuffer(top=3, height=20)
lowerConsole = ss.buildBuffer(bottom=2, top=25, background = 117)

# start the server
ss.start() 

Now you can manipulate screen from any process.

def linePrinter(cs: line):
    for i in range(100, 200):
        cs.v = "xxx" + str(i) * 3
        time.sleep(0.2)


def linePrinter2(cs: line):
    cs.total = 200
    for i in range(0, 200):
        cs.count = i
        time.sleep(0.2)


def bufferPrinter(bs: buffer):
    for i in range(1000, 3000):
        bs.append(('\u001b[48;5;13m') + (str(i) * (2)))
        bs.append((str(i) * 13))
        time.sleep(0.1)

pr = [Process(target=linePrinter, args=[l1]),
      Process(target=linePrinter2, args=[l2]),
      Process(target=bufferPrinter, args=[upperConsole]),
      Process(target=bufferPrinter, args=[lowerConsole])]

for p in pr:
    p.start()

for p in pr:
    p.join()

ss.close()

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

mpscreen-0.6.6.tar.gz (5.2 kB view details)

Uploaded Source

Built Distribution

mpscreen-0.6.6-py3-none-any.whl (10.1 kB view details)

Uploaded Python 3

File details

Details for the file mpscreen-0.6.6.tar.gz.

File metadata

  • Download URL: mpscreen-0.6.6.tar.gz
  • Upload date:
  • Size: 5.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.15.0 pkginfo/1.6.1 requests/2.22.0 setuptools/20.7.0 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/3.5.2

File hashes

Hashes for mpscreen-0.6.6.tar.gz
Algorithm Hash digest
SHA256 cb13f93b828712251bdb90302b0d1211f8b4f11993ff11c170e21faf11ca8af3
MD5 cb3dde28285249bbab37d8b4c9659cbb
BLAKE2b-256 a6b9f4b6cf84322ba41961076705d281f112f2d41c28d36596aacc359c1519a2

See more details on using hashes here.

Provenance

File details

Details for the file mpscreen-0.6.6-py3-none-any.whl.

File metadata

  • Download URL: mpscreen-0.6.6-py3-none-any.whl
  • Upload date:
  • Size: 10.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.15.0 pkginfo/1.6.1 requests/2.22.0 setuptools/20.7.0 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/3.5.2

File hashes

Hashes for mpscreen-0.6.6-py3-none-any.whl
Algorithm Hash digest
SHA256 1b5ee4d2582fad2cbd3f09fb4f45cbf1629b40a34700c2df9079a2a0d1d9adc8
MD5 5c2e16a461165d5e4af54e18438fa4a7
BLAKE2b-256 7468e09903b39bc20023fbd76fe3d67f7dd527f2a38f13397524dd360b089eb7

See more details on using hashes here.

Provenance

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