Python curses.ascii - Introduction














































Python curses.ascii - Introduction




Introduction

curses.ascii is a module of curses package, and provides utilities for working with ASCII characters. This library has many function which helps us to check membership for any character in ASCII classes as well as constants for basic control characters such as backspace, tab, space and others. The curses.ascii is used mainly for working with ascii character in text based terminals and for displaying text information on old character cell displays etc.

curses.ascii provides 36 constants for control charcters such as backspace, space, tab etc. These constants are not of much use today but are based on the old teleprinter conventions. Some of the control characters that curses.ascii provides are "BS" for backspace, "NL" for new line etc. curses.ascii also has a variable named "controlnames" which is a list of 33 control character constants.

These function are used to check whether a charcter belongs to a specific class of ASCII set. They take a single character string and returns the output as a boolean value. for e.g. - isalpha(character), isdigit(character) etc.

Apart from membership functions curses.ascii also provides 4 other function which are ascii(character), ctrl(character), alt(character), unctrl(character). These function takes either a string character or an ASCII value and return a string or integer output.

Importing and displaying all the control character and functions part of curses.ascii:-



NEXT->  

Comments