SL4A - Python Library


Python has a standard library, which includes a wide variety of routines that help you code and reuse these codes easily. A Module is a Python file that has definitions of variables and a set of related routines or functions.

Some of the core Modules provided by the Python library are as follows −

  • Built-in Functions and Exceptions − Python imports both these modules when it starts up and makes their content available for all programs. The built-in module defines built-in functions like len, int, range, while the exceptions module defines all built-in exceptions.

  • Operating System Interface Modules − The OS module makes available, the functions that enables performing OS level operations through scripts.

  • Type Support Modules − Type support modules include string module-to implement, commonly used string operations; math module provides mathematical operations etc.

  • Regular Expressions − Regular Expressions are string patterns written in a specific syntax, which can be used to match or extract strings or substrings. The re module provides Regex support for Python.

  • Language Support Modules − The sys module gives you access to various interpreter variables, such as the module search path, and the interpreter version. The operator module provides functional equivalents to many built-in operators. The copy module allows you to copy objects. Finally, the gc module gives you more control over the garbage collector facilities in python 2.0.

About JSON

The JavaScript Object Notation (JSON) is a data-interchange format. Though many programming languages support JSON, it is especially useful for JavaScript-based apps, including websites and browser extensions. JSON can represent numbers, Booleans, strings, null, arrays (ordered sequences of values), and objects (string-value mappings) made up of these values (or of other arrays and objects).