Skip to main content

window-terminal is a Python module for start new Terminal Window with print and input control.

Installation

Install from pip.

pip install window-terminal

Usage

Below there are example, how to use this module.

import time
from window_terminal import WindowTerminal

#### First Example: Print on Windows Terminal ####

# To instantiate a Window Terminal call 'WindowTerminal.create_window()'
window1 = WindowTerminal.create_window()

# To Open a Window Terminal, call 'open()' from a object
window1.open()

# Print on Windown Terminal, call 'print()'
window1.print('Hello I\'m a Window Terminal!')

# The Window Terminal can be closed at any time
# For example: close after 3 seconds
time.sleep(3)
window1.close()

#### Second Example: Interact with Window Terminal ####

# Insantiating and opening it more...
window2 = WindowTerminal.create_window()
window2.open()

# And printing...
window2.print('### Welcome to Window Terminal 2 ###')

# To prompt for something to Window Terminal call 'input()'
# Current thread will be blocked until input is answered
something = window2.input('Type something here: ')

# Priting result...
print('Window Temrinal 2 replied:', repr(something))

# Closing Window Terminal 2
window2.close()

#### Third Example: Async Interact with Window Terminal ####

# # Insantiating and opening it for the last time...
window3 = WindowTerminal.create_window()
window3.open()

# We can define a function to be called when input is answered
def input_callback(result):
    print('Window Terminal 3 replied:', repr(result))

# Now, current thread not will be blocked, when 'input()' is called
window3.input('Other input, type something more here: ', input_callback)

# To prevent the script from closing,  call 'wait_close()' to block
# current thread, until Window Terminal close (for example: user action).
window3.wait_close()

# Printing after Window Terminal 3 close
print('Window Terminal 3 was closed!')

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Please make sure to update tests as appropriate.

License

MIT

Metadata

Release files for window-terminal 1.0.6

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for window-terminal 1.0.6
File Size Uploaded
window-terminal-1.0.6.tar.gz 4.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for window-terminal 1.0.6
File Interpreter ABI Platform
window_terminal-1.0.6-py3-none-any.whl Python 3 none any Details

Total release size: 10.4 kB

Release files / window-terminal-1.0.6.tar.gz

Download URL window-terminal-1.0.6.tar.gz
Size 4.6 kB
Tags Source
SHA-256 checksum
How to use checksums
36ea17c7bed1c02abe98ca5b5ad47a21116510629c928dcfe14da5d317572c97
BLAKE2b-256 checksum
How to use checksums
4886af7a71c039929e7e183abf0ec0ee36306cb511eb60d3d705e11afc83c653
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.13.0 pkginfo/1.5.0.1 requests/2.18.4 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.35.0 CPython/3.7.3

Release files / window_terminal-1.0.6-py3-none-any.whl

Download URL window_terminal-1.0.6-py3-none-any.whl
Size 5.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e18b18ba6237d299c3a1689f00c20324649ca62fc39bc91c4cdd133488ab9896
BLAKE2b-256 checksum
How to use checksums
7b436b64fa527cc99b5ca2ac60c91cddc87ac12ffb1a2bbee8f7bd283bd55a3f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.13.0 pkginfo/1.5.0.1 requests/2.18.4 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.35.0 CPython/3.7.3

Release history Release notifications | RSS feed

This release

1.0.6 This release

2 release files

1.0.5

2 release files

1.0.4

2 release files

1.0.3

2 release files

1.0.2

2 release files

1.0.1

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page