InputConsole
InputConsole is a console for Python that will keep all output above the input line without interrupting the input line.
$ pip3 install inputconsole
Example
from inputconsole import InputConsole
# Create the console
console = InputConsole()
# Register a command
def help(args):
console.write("I don't want to help you {0}.\n".format(args[0]))
console.register_command('help', help)
# Set unknown command handler, Return 'True' for command handled or
# 'False' for command not handled.
def unknown_command_handler(command):
console.write("Unknown command: " + command)
return True
console.set_unknown_command_handler(unknown_command_handler)
# Start listening for input on a new thread
# Input line will always stay at the bottom
console.listen_for_input()
# Generate random output to keep the output thread active.
def steady_flow():
num = 0
while True:
console.write("this is an output message: {0}\n".format(num))
time.sleep(2)
num += 1
t = Thread(target=steady_flow)
t.start()
t.join()
Metadata
Release files for inputconsole 1.0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| inputconsole-1.0.1.tar.gz | 3.3 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| inputconsole-1.0.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 7.5 kB
Release files / inputconsole-1.0.1.tar.gz
| Download URL | inputconsole-1.0.1.tar.gz |
|---|---|
| Size | 3.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
e19b820789038b78974b2b7cee05f80fe4514ca681678509b5ae0183ea731a5d
|
|
BLAKE2b-256 checksum How to use checksums |
c1c4db2014308acb1de1563950d00f38318acd1c9a263874add6b12a4d43b61f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.4.1 importlib_metadata/4.0.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.9.1
|
Release files / inputconsole-1.0.1-py3-none-any.whl
| Download URL | inputconsole-1.0.1-py3-none-any.whl |
|---|---|
| Size | 4.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
cf24d3718b42d560c1335aa895d59f984438f5f919d3c123816bd4dd4792c4a4
|
|
BLAKE2b-256 checksum How to use checksums |
de36bdc791ae9ae40d2702fa7a1395a170c16a47906d7ef0a1cd9b42768637ad
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.4.1 importlib_metadata/4.0.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.9.1
|