A console for Python that will keep all output above the input line without interrupting the input line.
Project description
InputConsole
A console for Python that will keep all output above the input line without interrupting the input line.
Install
$ 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)
# 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()
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
inputconsole-0.0.1.tar.gz
(3.0 kB
view hashes)
Built Distribution
Close
Hashes for inputconsole-0.0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d242043c68088993048a0c5e367ca4b5233219db8acea94185acd65122416873 |
|
MD5 | d20f9390a91eb30d9c53af8c53e43050 |
|
BLAKE2b-256 | b537fd4b9139c1cac336173ff98fb49391f4208ee72b3104ff81e3957db8f713 |