Builtin Modules
Python - Built-in Modules
Section titled “Python - Built-in Modules”The Python interactive shell has a number of built-in functions. They are loaded automatically as a shell starts and are always available, such as print() and input() for I/O, number conversion functions int(), float(), complex(), data type conversions list(), tuple(), set(), etc. Python interactive shellprint()input()int()float()complex()list()tuple()set() In addition to built-in functions, a large number of pre-defined functions are also available as a part of libraries bundled with Python distributions. These functions are defined in modules are called built-in modules. modules Built-in modules are written in C and integrated with the Python shell. Each built-in module contains resources for certain system-specific functionalities such as OS management, disk IO, etc. The standard library also contains many Python scripts (with the .py extension) containing useful utilities.
To display a list of all available modules, use the following command in the Python console:
>>> help('modules')
IPython _weakrefset heapq secrets__future__ _winapi hmac select_abc abc html selectors_ast aifc http setuptools_asyncio antigravity idlelib shelve_bisect argparse imaplib shlex_blake2 array imghdr shutil_bootlocale ast imp signal_bz2 asynchat importlib simplegeneric_codecs asyncio ind site_codecs_cn asyncore inspect six_codecs_hk atexit io smtpd_codecs_iso2022 audioop ipaddress smtplib_codecs_jp autoreload ipython_genutils sndhdr_codecs_kr backcall itertools socket_codecs_tw base64 jedi socketserver_collections bdb json sqlite3_collections_abc binascii keyword sre_compile_compat_pickle binhex lib2to3 sre_constants_compression bisect linecache sre_parse_contextvars builtins locale ssl_csv bz2 logging stat_ctypes cProfile lzma statistics_ctypes_test calendar macpath storemagic_datetime cgi mailbox string_decimal cgitb mailcap stringprep_distutils_findvs chunk marshal struct_dummy_thread cmath math subprocess_elementtree cmd mimetypes sunau_functools code mmap symbol_hashlib codecs modulefinder sympyprinting_heapq codeop msilib symtable_imp collections msvcrt sys_io colorama multiprocessing sysconfig_json colorsys netrc tabnanny_locale compileall nntplib tarfile_lsprof concurrent nt telnetlib_lzma configparser ntpath tempfile_markupbase contextlib nturl2path test_md5 contextvars numbers tests_msi copy opcode textwrap_multibytecodec copyreg operator this_multiprocessing crypt optparse threading_opcode csv os time_operator ctypes parser timeit_osx_support curses parso tkinter_overlapped cythonmagic pathlib token_pickle dataclasses pdb tokenize_py_abc datetime pickle trace_pydecimal dbm pickleshare traceback_pyio decimal pickletools tracemalloc_queue decorator pip traitlets_random difflib pipes tty_sha1 dis pkg_resources turtle_sha256 distutils pkgutil turtledemo_sha3 doctest platform types_sha512 dummy_threading plistlib typing_signal easy_install poplib unicodedata_sitebuiltins email posixpath unittest_socket encodings pprint urllib_sqlite3 ensurepip profile uu_sre enum prompt_toolkit uuid_ssl errno pstats venv_stat faulthandler pty warnings_string filecmp py_compile wave_strptime fileinput pyclbr wcwidth_struct fnmatch pydoc weakref_symtable formatter pydoc_data webbrowser_testbuffer fractions pyexpat winreg_testcapi ftplib pygments winsound_testconsole functools queue wsgiref_testimportmultiple gc quopri xdrlib_testmultiphase genericpath random xml_thread getopt re xmlrpc_threading_local getpass reprlib xxsubtype_tkinter gettext rlcompleter zipapp_tracemalloc glob rmagic zipfile_warnings gzip runpy zipimport_weakref hashlib sched zlib
Enter any module name to get more help. Or, type "modules spam" to searchfor modules whose name or summary contain the string "spam".`>>> help(‘modules’)
IPython _weakrefset heapq secrets future _winapi hmac select _abc abc html selectors _ast aifc http setuptools _asyncio antigravity idlelib shelve _bisect argparse imaplib shlex _blake2 array imghdr shutil _bootlocale ast imp signal _bz2 asynchat importlib simplegeneric _codecs asyncio ind site _codecs_cn asyncore inspect six _codecs_hk atexit io smtpd _codecs_iso2022 audioop ipaddress smtplib _codecs_jp autoreload ipython_genutils sndhdr _codecs_kr backcall itertools socket _codecs_tw base64 jedi socketserver _collections bdb json sqlite3 _collections_abc binascii keyword sre_compile _compat_pickle binhex lib2to3 sre_constants _compression bisect linecache sre_parse _contextvars builtins locale ssl _csv bz2 logging stat _ctypes cProfile lzma statistics _ctypes_test calendar macpath storemagic _datetime cgi mailbox string _decimal cgitb mailcap stringprep _distutils_findvs chunk marshal struct _dummy_thread cmath math subprocess _elementtree cmd mimetypes sunau _functools code mmap symbol _hashlib codecs modulefinder sympyprinting _heapq codeop msilib symtable _imp collections msvcrt sys _io colorama multiprocessing sysconfig _json colorsys netrc tabnanny _locale compileall nntplib tarfile _lsprof concurrent nt telnetlib _lzma configparser ntpath tempfile _markupbase contextlib nturl2path test _md5 contextvars numbers tests _msi copy opcode textwrap _multibytecodec copyreg operator this _multiprocessing crypt optparse threading _opcode csv os time _operator ctypes parser timeit _osx_support curses parso tkinter _overlapped cythonmagic pathlib token _pickle dataclasses pdb tokenize _py_abc datetime pickle trace _pydecimal dbm pickleshare traceback _pyio decimal pickletools tracemalloc _queue decorator pip traitlets _random difflib pipes tty _sha1 dis pkg_resources turtle _sha256 distutils pkgutil turtledemo _sha3 doctest platform types _sha512 dummy_threading plistlib typing _signal easy_install poplib unicodedata _sitebuiltins email posixpath unittest _socket encodings pprint urllib _sqlite3 ensurepip profile uu _sre enum prompt_toolkit uuid _ssl errno pstats venv _stat faulthandler pty warnings _string filecmp py_compile wave _strptime fileinput pyclbr wcwidth _struct fnmatch pydoc weakref _symtable formatter pydoc_data webbrowser _testbuffer fractions pyexpat winreg _testcapi ftplib pygments winsound _testconsole functools queue wsgiref _testimportmultiple gc quopri xdrlib _testmultiphase genericpath random xml _thread getopt re xmlrpc _threading_local getpass reprlib xxsubtype _tkinter gettext rlcompleter zipapp _tracemalloc glob rmagic zipfile _warnings gzip runpy zipimport _weakref hashlib sched zlib
Enter any module name to get more help. Or, type “modules spam” to search for modules whose name or summary contain the string “spam”.` Learn about some of the frequently used built-in modules in the next few chapters.