Skip to main content

Manyterm - spawn multiple terminals to print to

Project description

Manyterm

PyPI - Version PyPI - Downloads Donate
Spawn multiple terminals to print to (or get input from).
Or share terminals between python programs.
Compatible with Windows, Linux, and MacOS.

Installation

pip install manyterm or pip3 install manyterm

Usage

import manyterm 

t1 = manyterm.Terminal() # make a new window

t1.print("Hello World") # print to the window

t1.print("supercalifragilisticexpialidocious", end="") # default end="\n"

t1.close() # close the window

Description

There are two types of terminals that can be made:

  1. One to Many manyterm.Terminal():
  • New terminals can printed to or be asked for input.
  • tests/print.py is an example of how to use printing.
  • tests/input.py is an example of how to use input.
  1. Many to One manyterm.SharedTerminal():
  • Create a "shared" terminal that can be accessed from many independent python programs.
  • Run several instances of tests/shared.py concurrently to share one terminal.
  • Each instance will connect to the terminal based on the uid.
  • Then run tests/close_shared.py to close the terminal.

Notes:

  • Terminals are probably not thread safe.
  • No errors will be thrown if trying to print to a closed terminal, however if you are using One to Many then you can check the boolean return of print to see if it was successful.
  • The title of the window can be changed in Linux with the title parameter.
  • The size of the window can be changed in Linux and Windows with the cols and rows parameter, unit is characters.

How it works:

A server is used to print to client windows based on a uuid. When a new window object is made manyterm.Terminal() the program checks to make sure that the server is running, assigns itself a uuid, and then the program calls itself from a new terminal using the uuid as an argument. The new program contacts the server with its' uuid and the connection is made. For "Many to One" the window becomes the server and the user program becomes the client.

Windows 11

Picture showing windows example

Linux (Mint 22.1)

Picture showing windows example

MacOS Sonoma

Picture showing windows example

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

manyterm-2.0.0.tar.gz (6.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

manyterm-2.0.0-py3-none-any.whl (7.3 kB view details)

Uploaded Python 3

File details

Details for the file manyterm-2.0.0.tar.gz.

File metadata

  • Download URL: manyterm-2.0.0.tar.gz
  • Upload date:
  • Size: 6.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.12.3

File hashes

Hashes for manyterm-2.0.0.tar.gz
Algorithm Hash digest
SHA256 358870217d3b5582e0b273b07bd29b32c307574c36fb66a176c8f4b962528873
MD5 f2bfae6cd8b0fdc8638c33849fc3f3eb
BLAKE2b-256 7101d5d7c4c20fba9d951f3ff1a09765ffa39280f7355539e61f71713fa3cfe0

See more details on using hashes here.

File details

Details for the file manyterm-2.0.0-py3-none-any.whl.

File metadata

  • Download URL: manyterm-2.0.0-py3-none-any.whl
  • Upload date:
  • Size: 7.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.12.3

File hashes

Hashes for manyterm-2.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 2cc6003368f986ea801679cff6546bc1225c199a1d7b1daf7a73c41f43fcd880
MD5 c0278a0c9776ca39e2ec36bb3c8c204a
BLAKE2b-256 cc13715a94d252112a3e53f72d8911a46216c437b0023906c03ec61da5d04f04

See more details on using hashes here.

Supported by

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