We’re rewarding the question askers & reputations are being recalculated! Read more.

Python is a general-purpose, interpreted high-level programming language.

Python is an easy to learn, powerful programming language. It has efficient high-level data structures and a simple but effective approach to object-oriented programming. Python’s elegant syntax and dynamic typing, together with its interpreted nature, make it an ideal language for scripting and rapid application development in many areas on most platforms.

The Python interpreter and the extensive standard library are freely available in source or binary form for all major platforms from the Python Web site, http://www.python.org/, and may be freely distributed. The same site also contains distributions of and pointers to many free third party Python modules, programs and tools, and additional documentation. The Python Tutorial

Syntax Highlighting

If your question or answer includes Python code, you can enable Python syntax highlighting by doing the following:

<!-- language: lang-py -->

    code goes here

Here's what it looks like on a “Hello, world!” program:

#!/usr/bin/env python3

def main():
    print('Hello, world!')

if __name__ == '__main__':

Frequently Asked Questions

  1. How can I get Python syntax highlighting for the listings package?
  2. Issues with Perl or Python scripts when installing
  3. Using Python within LaTeX
  4. Generating a truth table in LaTeX using the Cheetah framework
history | excerpt history