Skip to main content

Advanced Input

Advanced input for python, where you can read in just one character or have inputs priority ordered.

Usage

from advanced-input import get_advanced_input, PriorityOrder
from threading import Thread
from time import sleep

input_handler = get_advanced_input()

def thread_one():
    user_input = input_handler.input(priority=PriorityOrder.High)
    print(user_input)

def main():
    backgroundThread = Thread(target=thread_one)
    backgroundThread.start()
    sleep(.1)
    input_handler.read("Press any character to exit...", PriorityOrder.Low)
    input_handler.stop()

This will result in a user input for thread_one being created before the main function's exit will be available. Normally, this would result in the program exiting, before accepting the user input of thread_one. With this, thread one will be in a higher priority than main, and that will be the first to be served the user's input. Additionally, Read() returns when one character is pressed.

If there are multiple inputs with the same priority, it will return them in a first come last serve method.

Windows quirks

Due to how Windows works with new line (\r\n), on Windows it is not possible to read the "Carriage Return" (\r) character. It will always return "Line Feed" (\n) instead. Due to how Windows console works, the default (utf-8) encoding input will not work with some special character. For it to work, please specify the encoding of your system.

Metadata

Release files for advanced-input 0.2.2

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

Source distribution (sdist)

Source distribution for advanced-input 0.2.2
File Size Uploaded Provenance Actions
advanced_input-0.2.2.tar.gz 43.6 kB Without provenance Details for advanced_input-0.2.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for advanced-input 0.2.2
File Interpreter ABI Platform Actions
advanced_input-0.2.2-py3-none-any.whl Python 3 none any Details for advanced_input-0.2.2-py3-none-any.whl

Total release size: 87.3 kB

Release files / advanced_input-0.2.2.tar.gz

Download URL advanced_input-0.2.2.tar.gz
Size 43.6 kB
Tags Source
SHA-256 checksum
How to use checksums
a3902b91361e20b92c6d2fafbe1fc283a072b2ef8ab7aa73fe50c0fed487da38
BLAKE2b-256 checksum
How to use checksums
a165815c27017ac44c26dc239cee2f35bedd5885394ba5e24986da84bd36d82c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.0.0 CPython/3.9.13

Release files / advanced_input-0.2.2-py3-none-any.whl

Download URL advanced_input-0.2.2-py3-none-any.whl
Size 43.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
536f4336e42e3c6a5cc24f92459fca5d8f14187577dc4ff505c9ae10d842e358
BLAKE2b-256 checksum
How to use checksums
9dc2fde5e1ae717326eda566849ebad6964e4c822745ec55c8fdd531eafb3d01
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.0.0 CPython/3.9.13

Security for advanced-input 0.2.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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