modules by defaultthe chargrid render(function clears the screen before printing the gridbut this can be prevented by passing false as we have done here here is the grid that results from the preceding doctests%%%%%********************************************@@@@@@@@@@@@@@@pleasantville+++++++++@@@@@@@@@@@@@@%%%%################################################################***##***#this is the chargrid module #***##***################################***################################*************************************************the module begins in the same way as the textutil modulewith shebang linecopyright and license commentsand module docstring that describes the module and has the doctests quoted earlier then the code proper begins with two importsone of the sys module and the other of the subprocess module the subprocess module is covered more fully in the module has two error-handling policies in place several functions have char parameter whose actual argument must always be string containing exactly one charactera violation of this requirement is considered to be fatal coding errorso assert statements are used to verify the length but passing out-of-range row or column numbers is considered erroneous but normalso custom exceptions are raised when this happens we will now review some illustrative and key parts of the module' codebeginning with the custom exceptionsclass rangeerror(exception)pass class rowrangeerror(rangeerror)pass class columnrangeerror(rangeerror)pass none of the functions in the module that raise an exception ever raise rangeerrorthey always raise the specific exception depending on whether an out-of-range row or column was given but by using hierarchywe give users of the module the choice of catching the specific exceptionor to catch either of them by catching their rangeerror base class note also that inside doctests the exception names are used as they appear herebut if the module is imported with import chargridthe exception names areof coursechargrid rangeerrorchargrid rowrangeerrorand chargrid columnrangeerror