Python package - input_num is like input but it only accepts numbers
Project description
input_num
Python package - input_num is like input but it only accepts numbers
Instalation
-
Windows / macOS
Run
python3 -m pip install input_num
-
Linux
Run
python3 -m pip install input_num
Usage
-
Windows / macOS / Linux
Add this to your script:
import input_num
input_num("Enter your age: ")
Command scheme:
input_num("Question: ", AllowNegativeNumbers, DoesPressingEnterReturnNothing)
-
First option: If you want to allow only positive numbers (numbers WITHOUT - at the begining), use
input_num("Something", False)
. False just means Allow negative numbers = False And it is optional argument Default value is True -
Second option: There is also second option, does pressing enter return "" ? Set it to False to make pressing enter ask you again. Example:
input_num("Try pressing enter: ", True, False)
- this allows negative numbers and disallows entering nothing. It is optional argument Default value is True
⚠️ If you want to set only second option, set the first option too ⚠️
-
Uninstallation
-
Windows / macOS
Run
python3 -m pip uninstall input_num
-
Linux
Run
python3 -m pip uninstall input_num
FAQ
-
Question
Answernot enough
Do you like this? Hit that ⭐!
Use the star button as way to show us, that it works
Forks and pull requests are welcome of course
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
Hashes for input_num-0.1.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1e8b869d4b94f30f1ec62f7f8f0c0711d31bf6c5a2c688a629f8c60730f78ec6 |
|
MD5 | 1109015cb27c878d55d7437e51f6652f |
|
BLAKE2b-256 | c54a1ab80c7b709a3235e3cb3d3686b05c79a1155ff5f6f7ef065a15b0c9617c |