Python’s standard library defines its immediately available capabilities, as well as “extras” that can be incorporated into a program easily and quickly, by importing built-in modules.

The immediately available capabilities form the core of the language. They include all the basic datatypes and their operations: both low-level types such as integer, float and complex, as well as higher-level ones like lists, iterators, strings,, tuples, sets, and dictionaries.

Other modules in the standard library offer a wide range of further capabilities, for example:

  • The os module provides access to operating-system services, providing standardized access and portability across different operating systems. This includes access to and management of the environment that the Python process is running in; operations to the file system, like file creation and access via file descriptors; directory management; and access to miscellaneous system information.
  • The io module provides stream-oriented I/O. By importing io, a program can create, open, close stream objects, as well as read and write various types of data to streams, such as formatted or unformatted ASCII and binary data.
  • The math, random, datetime and sys modules all provide the useful sorts of functionality suggested by their names. To get a peek at what they can do, import them and run help().

The full spectrum of built-in modules provides programs with a very broad set of capabilities, including access to Internet services and protocols, interprocess communications, XML tools, multimedia and much more. A comprehensive list is beyond the scope of this document; see online sources for more information.

 
©  |   Cornell University    |   Center for Advanced Computing    |   Copyright Statement    |   Inclusivity Statement