Study of Python (programming language)
Aim: Study of Python (programming language)
THEORY:
a) Introduction:
Python is an object-oriented high-level programming language, first released by Guido van Rossum in 1991. Python has a fully dynamic type system and uses automatic memory management; it is thus similar to Perl, Ruby, Scheme, Smalltalk, and Tcl.
The philosophy behind Python is noteworthy among high-level programming languages because it emphasizes the importance of programmer effort over computer effort, and because it rejects more arcane language features, prioritizing readability over speed or expressiveness. Python is often characterized as minimalist, although this only applies to the core language’s syntax and semantics; the standard library provides the language with a large number of additional libraries and extensions.
b) Syntax and Semantics:
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. Python uses indentation, rather than curly braces, to delimit statement blocks. An increase in indentation comes after certain statements; a decrease in indentation signifies the end of the current block. Python’s statements include:
* The if statement, which conditionally executes a block of code, along with else and elif (a contraction of else-if).
* The while statement, which runs a block of code until a condition is False.
* The for statement, which iterates over an iterable, capturing each element to a local variable for use by the attached block.
* The class statement, which executes a block of code and attaches its local namespace to a class, for use in object oriented programming.
* The def statement, which defines a function.
Each statement has its own semantics:
for e.g. the def statement does not execute its block immediately, unlike most other statements.
CPython does not support continuations, and according to Guido van Rossum, never will. However, better support for co routine-like functionality is provided in 2.5, by extending Python’s generators. Prior to 2.5, generators were lazy iterators — information was passed monodirectionally out of the generator.
c) Implementation :
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, including most modern Unices and Microsoft Windows; see the full list for more. The code base is written in compliant C89, and is easily portable to most operating systems, especially POSIX-compliant or Unix-like operating systems.
Python was originally developed as a scripting language for the Amoeba distributed operating system which was capable of making system calls; however, that version is no longer maintained. CPython was intended from almost its very conception to be cross-platform; its use and development on esoteric platforms such as Amoeba alongside more conventional ones like Unix or Macintosh has greatly helped in this regard.
Stack less Python is a significant fork of CPython that implements micro threads. It can be expected to run on approximately the same platforms that CPython runs on.
There are two other major implementations: Jython for the Java platform and Iron Python for the .NET platform. PyPy is an experimental self-hosting implementation of Python, in Python, that can output a variety of types of byte code and object code. Several other experimental implementations have been created, but have not yet been widely adopted.
Several programs exist to package Python programs into standalone executables, including py2exe and py2app.
Many Python programs can run on different Python implementations, on such disparate operating systems and execution environments, without change. In the case of the implementations running on top of the Java virtual machine or the Common Language Runtime, the platform-independence of these systems is harnessed by their respective Python implementation.
Many third-party libraries for Python (and even some first-party ones) are only available on Windows, Linux, BSD, and Mac OS X
Conclusion:
Thus we have studied Python (programming language) successfully
Leave a Reply