campy.util.simpio module

File: simpio.h

This file exports a set of functions that simplify input/output operations in Python and provide some error-checking on console input.

Modified from Marty Stepp’s CPP libraries.

@author sredmond

campy.util.simpio.append_space(prompt)[source]

Adds a space to the end of the given string if none is present.

campy.util.simpio.get_fn_cond(fn, pred, prompt='> ', reprompt='Invalid input. Please try again. ')[source]
campy.util.simpio.get_integer(prompt='Enter an integer: ', reprompt='Illegal integer format. Try again.')[source]
campy.util.simpio.get_line(prompt=None)[source]
campy.util.simpio.get_positive_real(prompt='Enter a positive number: ', reprompt='Illegal numeric format. Try again. ')[source]
campy.util.simpio.get_real(prompt='Enter a number: ', reprompt='Illegal numeric format. Try again.')[source]
campy.util.simpio.get_yes_or_no(prompt='Yes or No? ', reprompt="Please type a word that starts with 'Y' or 'N': ", default=None)[source]