Skip to main content

A better input() for python

Project description

UpgradedInput

A better, minimal input() wrapper for python

Features compared to python's default input()

  • Supports hooks for functions (Before and after input, on exception and on runtime error)

How to use

Install the module

pip install UpgradedInput

Use the module Example:

from UpgradedInput import UpgradedInput

# initialize
inp = UpgradedInput()

# Example of hooks (All of them can be left at the dafult state (None))
def before():
    print("Before!")

def after():
    print("After!")

def exception():
    print("Exception!")

def runtime_error():
    print("Runtime error!")

# Initialize the hooks
inp.before_input_function = before
inp.after_input_function = after
inp.exception_close_input_function = exception
inp.runtime_error_function = runtime_error # say we lost sys.stdin or something else that triggers a runtime error

print(inp.input()) # final call to the wrapper

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

upgradedinput-0.0.5.tar.gz (3.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

upgradedinput-0.0.5-py3-none-any.whl (4.3 kB view details)

Uploaded Python 3

File details

Details for the file upgradedinput-0.0.5.tar.gz.

File metadata

  • Download URL: upgradedinput-0.0.5.tar.gz
  • Upload date:
  • Size: 3.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.5

File hashes

Hashes for upgradedinput-0.0.5.tar.gz
Algorithm Hash digest
SHA256 77e876614d5f223e84483ee5eecb4bdb4f207e2a4c27de8cd91ac776860ee564
MD5 94589b919abe95d25ff06fcdfd1aaac9
BLAKE2b-256 e3e97b703bda420b5b66f4b84a2394bb2cc925f1f211d07ecf9c1ab610b2529d

See more details on using hashes here.

File details

Details for the file upgradedinput-0.0.5-py3-none-any.whl.

File metadata

  • Download URL: upgradedinput-0.0.5-py3-none-any.whl
  • Upload date:
  • Size: 4.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.5

File hashes

Hashes for upgradedinput-0.0.5-py3-none-any.whl
Algorithm Hash digest
SHA256 4747d411d1e500985465fca22b9fe2cd2cea3572a695af1a2ea5480dd44f4301
MD5 7515d5fc5ecc73a83f917eb99b208fe7
BLAKE2b-256 edf092cc29c98371fb8c678f7de0b89a7e7754c30f619799c50e22f90685076f

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page