Skip to main content

Easier input for Python

Project description

Autoinput

This library is for easier input in Python. It is 100% that you don't want to do this:

while 1:
      try:
          x = int(input())
          break
      except:
          print("Please input a number")

because it is 6 lines when you can have 1 line:

x = autoinput("", autoinput_type.INTEGER)

and everything is inside the function. No work by hands.

how to use

Here is the definition

def autoinput(outstring: str, typeel, pipe_in: Callable[[str], str]=input, pipe_out: Callable[[str], None]=print, pipe_out_end_name: str="end", parser=None) -> Any:

First argument - outstring, string to show.

Second argument - typeel, use autoinput_type enum to form this (example: autoinput_type.INTEGER | autoinput_type.ARRAY)

kwargs:

pipe_in - for custom input function (for example if you use GUI)

pipe_out - for custom output function

parser - for custom parser (don't use with autoinput_type except of autoinput_type.ARRAY)

pipe_out_end_name - if your custom output function doesn't have parameter like print's end use None, if has but called not end use the parameter to specify the name.

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

autoinput-1.1.tar.gz (3.7 kB view details)

Uploaded Source

Built Distribution

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

autoinput-1.1-py3-none-any.whl (4.2 kB view details)

Uploaded Python 3

File details

Details for the file autoinput-1.1.tar.gz.

File metadata

  • Download URL: autoinput-1.1.tar.gz
  • Upload date:
  • Size: 3.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.2

File hashes

Hashes for autoinput-1.1.tar.gz
Algorithm Hash digest
SHA256 50284ae611ed13fcf3c0a9118951b06dc404b256159373bff0c3ffbea4c0e87d
MD5 334b9ad169a12c8f811085197e0a2787
BLAKE2b-256 607fd591decdc3fdb1280b2ff72453f1cc6c6e086b8894b97be4b69db2d81659

See more details on using hashes here.

File details

Details for the file autoinput-1.1-py3-none-any.whl.

File metadata

  • Download URL: autoinput-1.1-py3-none-any.whl
  • Upload date:
  • Size: 4.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.2

File hashes

Hashes for autoinput-1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 2a988f8d726e060a0e3f273dd20203e74d1401cf619af415d5c81b6b5c9d1b6b
MD5 5f45ac0483d5d5513f053690ecf754fc
BLAKE2b-256 d844e608e4aa5e58a96319e4b67c90f1f288de29a5d606830ffae97eb6c55255

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