Coder Social home page Coder Social logo

hexagoncore / input_num Goto Github PK

View Code? Open in Web Editor NEW
0.0 0.0 0.0 146 KB

Python package - input_num is like input but it only accepts numbers.

License: MIT License

Python 100.00%
input-number python python-package python-packages number numbers only-numbers number-input terminal-based

input_num's Introduction

CodeFactor

input_num

Python package - input_num is like input but it only accepts numbers


Installation

  • 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 ⚠️

    Do you want to be reminded to update the package? Run input_num.allow_update() RIGHT AFTER importing the package.

Uninstallation

  • Windows / macOS

    Run python3 -m pip uninstall input_num

  • Linux

    Run python3 -m pip uninstall input_num

FAQ

  • Question

    Answer

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

input_num's People

Contributors

mp3martin avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.