Python is an interpreted, interactive, object-oriented programming language. It incorporates modules, exceptions, dynamic typing, very high level dynamic data types, and classes. It supports multiple programming paradigms beyond object-oriented programming, such as procedural and functional programming.

Python combines remarkable power with very clear syntax. It has interfaces to many system calls and libraries, as well as to various window systems, and is extensible in C or C++. It is also usable as an extension language for applications that need a programmable interface. Finally, Python is portable: it runs on many Unix variants including Linux and macOS, and on Windows.

Features

  • Very clear, readable syntax
  • Strong introspection capabilities
  • Intuitive object orientation
  • Natural expression of procedural code
  • Full modularity, supporting hierarchical packages
  • Exception-based error handling
  • Very high level dynamic data types
  • Extensive standard libraries and third party modules for virtually every task
  • Extensions and modules easily written in C, C++ (or Java for Jython, or .NET languages for IronPython)
  • Embeddable within applications as a scripting interface

Python is powerful... and fast

Fans of Python use the phrase "batteries included" to describe the standard library, which covers everything from asynchronous processing to zip files. The language itself is a flexible powerhouse that can handle practically any problem domain. Build your own web server in three lines of code. Build flexible data-driven code using Python's powerful and dynamic introspection capabilities and advanced language features such as meta-classes, duck typing and decorators.

Python lets you write the code you need, quickly. And, thanks to a highly optimized byte compiler and support libraries, Python code runs more than fast enough for most applications. The traditional implementation of CPython uses a bytecode virtual machine; PyPy supports just-in-time (JIT) compilation to machine code. Also, Jython and IronPython (see below) support JIT compilation on their respective virtual machine implementations.

Python plays well with others

Python can integrate with COM, .NET, and CORBA objects.

For Java libraries, use Jython, an implementation of Python for the Java Virtual Machine.

For .NET, try IronPython , Microsoft's new implementation of Python for .NET, or Python for .NET.

Python is also supported for the Internet Communications Engine (ICE) and many other integration technologies.

If you find something that Python cannot do, or if you need the performance advantage of low-level code, you can write extension modules in C or C++, or wrap existing code with SWIG or Boost.Python. Wrapped modules appear to your program exactly like native Python code. That's language integration made easy. You can also go the opposite route and embed Python in your own application, providing your users with a language they'll enjoy using.

Python runs everywhere

Python is available for all major operating systems: Windows, Linux/Unix, OS/2, Mac, Amiga, among others. There are even versions that run on .NET and the Java virtual machine. You'll be pleased to know that the same source code will run unchanged across all implementations.

Your favorite system isn't listed here? It may still support Python if there's a C compiler for it. Ask around on news:comp.lang.python - or just try compiling Python yourself.

Python is friendly... and easy to learn

The Python newsgroup is known as one of the friendliest around. The avid developer and user community maintains a wiki, hosts international and local conferences, runs development sprints, and contributes to online code repositories.

Python also comes with complete documentation, both integrated into the language and as separate web pages. Online tutorials target both the seasoned programmer and the newcomer. All are designed to make you productive quickly. The availability of first-rate books completes the learning package.

Python is Open

The Python implementation is under an open source license that makes it freely usable and distributable, even for commercial use. The Python license is administered by the Python Software Foundation.

Take a look at application domains where Python is used, or try the current download for yourself.

What's New

Python 3.12 is the newest major release of the Python programming language, and it contains many new features and optimizations. 3.12.2 is the latest maintenance release, containing more than 350 bugfixes, build improvements and documentation changes since 3.12.1.

Major new features of the 3.12 series, compared to 3.11

New features

  • More flexible f-string parsing , allowing many things previously disallowed (PEP 701).
  • Support for the buffer protocol in Python code (PEP 688).
  • A new debugging/profiling API (PEP 669).
  • Support for isolated subinterpreters with separate Global Interpreter Locks (PEP 684).
  • Even more improved error messages. More exceptions potentially caused by typos now make suggestions to the user.
  • Support for the Linux perf profiler to report Python function names in traces.
  • Many large and small performance improvements (like PEP 709 and support for the BOLT binary optimizer), delivering an estimated 5% overall performance improvement.

Type annotations

  • New type annotation syntax for generic classes (PEP 695).
  • New override decorator for methods (PEP 698).

Deprecations

  • The deprecated wstr and wstr_length members of the C implementation of unicode objects were removed, per PEP 623.
  • In the unittest module, a number of long deprecated methods and classes were removed. (They had been deprecated since Python 3.1 or 3.2).
  • The deprecated smtpd and distutils modules have been removed (see PEP 594 and PEP 632. The setuptools package continues to provide the distutils module.
  • A number of other old, broken and deprecated functions, classes and methods have been removed.
  • Invalid backslash escape sequences in strings now warn with SyntaxWarning instead of DeprecationWarning, making them more visible. (They will become syntax errors in the future.)
  • The internal representation of integers has changed in preparation for performance enhancements. (This should not affect most users as it is an internal detail, but it may cause problems for Cython-generated code.)