Manyterm - spawn multiple terminals to print to
Project description
Manyterm
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:
- One to Many
manyterm.Terminal():
- New terminals can printed to or be asked for input.
tests/print.pyis an example of how to use printing.tests/input.pyis an example of how to use input.
- Many to One
manyterm.SharedTerminal():
- Create a "shared" terminal that can be accessed from many independent python programs.
- Run several instances of
tests/shared.pyconcurrently to share one terminal. - Each instance will connect to the terminal based on the uid.
- Then run
tests/close_shared.pyto 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
titleparameter. - The size of the window can be changed in Linux and Windows with the
colsandrowsparameter, 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
Linux (Mint 22.1)
MacOS Sonoma
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
358870217d3b5582e0b273b07bd29b32c307574c36fb66a176c8f4b962528873
|
|
| MD5 |
f2bfae6cd8b0fdc8638c33849fc3f3eb
|
|
| BLAKE2b-256 |
7101d5d7c4c20fba9d951f3ff1a09765ffa39280f7355539e61f71713fa3cfe0
|
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2cc6003368f986ea801679cff6546bc1225c199a1d7b1daf7a73c41f43fcd880
|
|
| MD5 |
c0278a0c9776ca39e2ec36bb3c8c204a
|
|
| BLAKE2b-256 |
cc13715a94d252112a3e53f72d8911a46216c437b0023906c03ec61da5d04f04
|