Python is an interpreted programming language created by Guido van Rossum in 1990. Python is fully dynamically typed and uses automatic memory management; it is thus similar to Perl, Ruby, Scheme, Smalltalk, and Tcl. Python is developed as an open source project, managed by the non-profit Python Software Foundation, and is available for free from the project website. Python 2.4.3 was released on March 29, 2006.
While offering choice in coding methodology, Python's designers reject exuberant syntax, such as in Perl, in favor of a sparser, less cluttered one. As with Perl, Python's developers expressly promote a particular "culture" or ideology based on what they want the language to be, favoring language forms they see as "beautiful", "explicit" and "simple". For the most part, Perl and Python users differ in their interpretation of these terms and how they are best implemented (see TIMTOWTDI and Python philosophy).
Another important goal of the Python developers is making Python fun to use. This is reflected in the origin of the name (after the television series Monty Python's Flying Circus), in the common practice of using Monty Python references in example code, and in an occasionally playful approach to tutorials and reference materials. For example, the metasyntactic variables often used in Python literature are spam and eggs, instead of the traditional foo and bar.
Python is sometimes referred to as a "scripting language". In practice, it is used as a dynamic programming language for both application development and occasional scripting. Python has been used to develop many large software projects such as the Zope application server and the Mnet and BitTorrent file sharing systems. It is also extensively used by Google. *
Another important goal of the language is ease of extensibility. New built-in modules are easily written in C or C++. Python can also be used as an extension language for existing modules and applications that need a programmable interface.
Though the design of Python is somewhat hostile to functional programming (no tail-call elimination or good support for anonymous closures) and the Lisp tradition, there are significant parallels between the philosophy of Python and that of minimalist Lisp-family languages such as Scheme. Many past Lisp programmers have found Python appealing for this reason.
The last version released from CWI was Python 1.2. In 1995, Guido continued his work on Python at the Corporation for National Research Initiatives (CNRI) in Reston, Virginia where he released several versions of the software. Python 1.6 was the last of the versions released by CNRI.
Following the release of Python 1.6, and after Guido van Rossum left CNRI to work with commercial software developers, it became clear that the ability to use Python with software available under the GPL was very desirable. CNRI and the Free Software Foundation (FSF) interacted to develop enabling wording changes to the Python's free software license that would make it GPL-compatible. That year, Guido was awarded the FSF Award for the Advancement of Free Software.
Python 1.6.1 is essentially the same as Python 1.6, with a few minor bug fixes, and with the new GPL-compatible license.
Python 2.1 was a derivative work of Python 1.6.1, as well as of Python 2.0. Its license was renamed Python Software Foundation License. All intellectual property added, from the time of Python 2.1's alpha release on, is owned by the Python Software Foundation (PSF), a non-profit organization modeled after the Apache Software Foundation.
Planned changes include:
str/unicode types, and introduce a separate mutable bytes type
The Python programming language is actively used in industry and academia for a wide variety of purposes.
Python was designed to be a highly readable language. It aims toward an uncluttered visual layout, uses English keywords frequently where other languages use punctuation, and has notably fewer syntactic constructions than many structured languages such as C, Perl, or Pascal.
if statement, for conditionally executing blocks of code, along with else and elif (a contraction of else-if).
while statement runs a block of code until a condition is False.
for loops iterate over an iterable, capturing each element to a local variable for use by the attached block.
class statements execute a block of code and attach its local namespace to a class, for use in object oriented programming.
def defines a function.
Each statement has its own semantics: for example, the def statement does not execute its block immediately, unlike most other statements.
list — a mutable sequence.
tuple — an immutable sequence.
str — an immutable sequence of characters.
dict — a dictionary.
set — an approximation of a mathematical set (an unordered collection, where each element can only appear once).
This list is not exhaustive; there are many other types provided by Python - these are merely some of the most commonly used.
The standard Python interpreter also supports an interactive mode in which it acts as a kind of shell: expressions can be entered one at a time, and the result of their evaluation is seen immediately. This is a boon for those learning the language and experienced developers alike: snippets of code can be tested in interactive mode before integrating them into a proper program. As well, the Python shell is often used to interactively perform system tasks, such as modifying files.
Python also includes a unit testing framework for creating exhaustive test suites. While static typing aficionados see this as a replacement for a static type-checking system, Python programmers largely do not share this view.
Standard Python does not support continuations, and according to Guido van Rossum, never will. However, better support for coroutine-like functionality is planned, by extending Python's generators *.
The mainstream Python implementation, also known as CPython, is written in C, and is distributed with a large standard library written in a mixture of C and Python. CPython ships for a large number of supported platforms (see below) and can be ported to other platforms, most readily to POSIX (Unix-like) systems.
There are two other major implementations, Jython for the Java environment, and IronPython for the .NET and Mono environment.
| Unix-like | Desktop OSes | Special and embedded | Mainframe and other |
Python was originally developed as a scripting language for the Amoeba operating system capable of making system calls; however, that version is no longer maintained.
Many third-party libraries for Python (and even some first-party ones) are only available on Windows, Linux, BSD, and Mac OS X.
Python has a large standard library, which makes it well suited to many tasks. This comes from a so-called "batteries included" philosophy for Python modules. The modules of the standard library can be augmented with custom modules written in either C or Python. The standard library is particularly well tailored to writing Internet-facing applications, with a large number of standard formats and protocols (such as MIME and HTTP) supported. Modules for creating graphical user interfaces, connecting to relational databases, arithmetic with arbitrarily precise decimals, and manipulating regular expressions are also included.
The standard library is one of Python's greatest strengths. The bulk of it is cross-platform compatible, meaning that even heavily leveraged Python programs can often run on Unix, Windows, Macintosh, and other platforms without change.
It is currently being debated whether or not third-party but open source Python modules such as Twisted, NumPy, or wxPython should be included in the standard library, in accordance with the batteries included philosophy.
In contrast, a mark of unpythonic code is that it attempts to "write C++ (or Lisp, or Perl) code in Python"—that is, provides a rough transcription rather than an idiomatic translation of forms from another language.
The prefix Py- can be used to show that something is related to Python. Examples of the use of this prefix in names of Python applications or libraries include Pygame, a binding of SDL to Python (commonly used to create games), PyUI, a GUI encoded entirely in Python, and PySol, a series of solitaire card games programmed in Python.
Users and admirers of Python—most especially those considered knowledgeable or experienced—are often referred to as Pythonists, Pythonistas, and Pythoneers.
Python programming language | Class-based programming languages | Dynamically-typed programming languages | Free compilers and interpreters | Object-oriented programming languages | Scripting languages | Unix software
بيثون | Python programski jezik | Python | Python | Python | Python (programmeringssprog) | Python (Programmiersprache) | Python | Python | Python (programlingvo) | پایتون | Python (langage) | Python | 파이썬 | Python | Python | Python | Python programozási nyelv | Python (programmeertaal) | Python | Python | Python | Python | Python | Python (programovací jazyk) | Python (programski jezik) | Python | Python | Python (programspråk) | ไพทอน | Python (ngôn ngữ lập trình) | Python programlama dili | Python | Python
This article is licensed under the GNU Free Documentation License.
It uses material from the
"Python programming language".
Home Page • arts • business • computers • games • health • hospitals • home • kids & teens • news • physicians • recreation• reference • regional • science • shopping • society • sports • world