Adds functions to check if variables are integers and turns them into such.
Project description
Integer Checker
A lightweight Python module that handles converting compatable data types into integers.
Disclamer: Right now there is only the ability to use this when taking and converting user input. I will try to add more features later. This has only been tested in basic examples, please report any bugs so I can try to fix them.
Features
- Safe Integer Checking: Easily verify and force user inputs to be valid integers without crashing your program.
- Default Error Message: Has a default error message of "Please input a number!" This can be changed by adding a string as the second argument.
Installation
Just use pip as you normally would!
pip3 install int-checker
Usage Example
import int_checker
var1 = int_checker.conv_input("Give number: ", "This is a different error message")
print(2 + var1)
Syntax
The way you need to structure the code is quite simple. Using up to two arguments, you can define both the input request and error message, as shown before.
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file int_checker-0.1.1.tar.gz.
File metadata
- Download URL: int_checker-0.1.1.tar.gz
- Upload date:
- Size: 1.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
720b0187f7b1a633542d16b77d67110da1bc3daa848f7cdb2549711337159cfd
|
|
| MD5 |
0e3c3ea17bfd061178732115714ea866
|
|
| BLAKE2b-256 |
9cdc69153d7e84a68eb1b66205c183afd4617026bfac6b027e4183b3543cfae7
|
File details
Details for the file int_checker-0.1.1-py3-none-any.whl.
File metadata
- Download URL: int_checker-0.1.1-py3-none-any.whl
- Upload date:
- Size: 1.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
62f798e020a0c565dcb67d85729c9c9b1ab3275733cf65d24ad0b324cedd6208
|
|
| MD5 |
51f485d7e2006f4bec66d302aa8908c3
|
|
| BLAKE2b-256 |
0f1d9bcadafa71348a4046477c9b361838cce331e42f7c4a3dfec01f1207e8d9
|