UI.ShellUI.BTCInput
index
/home/flempriere/personal_projects/Languages/Python/BeginToCodeWithPython/03_UsefulPython/13_PythonAndGraphicalUserInterfaces/Exercises/03_GraphicalBankingApplication/UI/ShellUI/BTCInput.py

Exercise 13.3k BTCInput
 
Provides functions for reading and validating numbers and strings from user input
 
Routine Listings
----------------
read_text : read text from user input
read_int : read an int from user input
read_float : read a float from user input
read_int_ranged : read an int restricted to the interval [min_value, max_value]
read_float_ranged : read a float restricted to the interval [min_value, max_value]
read_number :
    interface function allowing the caller to pass a custom number parsing
    function to convert user input
read_number_ranged :
    interface function as for `read_number` but restricting the result to the
    interval [min_value, max_value]
 
Notes
-----
BTCInput can be run as a main program to read a README overview

 
Functions
       
read_float(prompt)
Displays a prompt and reads in a floating point number.
Keyboard interrupts (CTRL+C) are ignored
Invalid numbers are rejected
returns a float containing the value input by the user
read_float_ranged(prompt, min_value, max_value)
Displays a prompt and reads in a floating point number.
min_value gives the inclusive minimum value
max_value gives the inclusive maximum value
Raises an exception if max and min are the wrong way round
Keyboard interrupts (CTRL+C) are ignored
Invalid numbers are rejected
returns a number containing the value input by the user
read_int(prompt)
Displays a prompt and reads in an integer number.
Keyboard interrupts (CTRL+C) are ignored
Invalid numbers are rejected
returns an int containing the value input by the user
read_int_ranged(prompt, min_value, max_value)
Displays a prompt and reads in an integer point number.
min_value gives the inclusive minimum value
max_value gives the inclusive maximum value
Raises an exception if max and min are the wrong way round
Keyboard interrupts (CTRL+C) are ignored
Invalid numbers are rejected
returns a number containing the value input by the user
read_number(prompt, function)
Displays a prompt and reads in a floating point number.
Keyboard interrupts (CTRL+C) are ignored
Invalid numbers are rejected
returns a float containing the value input by the user
read_number_ranged(prompt, function, min_value, max_value)
Displays a prompt and reads in a number.
min_value gives the inclusive minimum value
max_value gives the inclusive maximum value
Raises an exception if max and min are the wrong way round
Keyboard interrupts (CTRL+C) are ignored
Invalid numbers are rejected
returns a number containing the value input by the user
read_text(prompt)
Displays a prompt and reads in a string of text.
Keyboard interrupts (CTRL+C) are ignored
returns a string containing the string input by the user
readme()

 
Data
        DEBUG_MODE = False
VERSION = '1.0.0'