Python is a widely used high level, general purpose,interpreted, object-oriented, dynamic programming language.
Its design philosophy emphasizes code readability, and its syntax allows programmers to express concepts in fewer lines than possible in other languages.
High level language- It’s a programming language which is closer to human language rather than machine language. They are more or less independent of a particular type of computer or OS.
Python is Interpreted language- It is processed at runtime by the interpreter. Python source code is automatically compiled into Python byte code and interpreted by the CPython interpreter.
OOPS- is a programming paradigm based on the concept of objects. Objects are instance of class which consists of data and methods.
Broad standard library
Interactive and batch processing mode
Extendable and Integration
Dynamic data type
Free and Open Source
Large standard libraries
Great Community and Support
Good Language for beginner
Pretty much anything you want
Easy-to-learn: Python has few keywords, simple structure, and a clearly defined syntax.
Easy-to-read: Python code is more clearly defined and visible to the eyes.
Easy-to-maintain: Python's source code is fairly easy-to-maintain.
Broad standard library: numpy, scipy, pandas
Interactive and batch processing mode: Python has support for an interactive mode which allows interactive testing and debugging as well as processing in batch.
Portable: Python is cross-platform compatible on UNIX, Windows, and Macintosh. Can run on a wide variety of hardware platforms with same interface.
Extendable and Integration: It can be easily integrated with C, C++, COM, ActiveX, CORBA, and Java. Low-level modules can be added to enable programmers to add or customize their tools to be more efficient.
Databases: Python provides interfaces to all major commercial databases.
GUI Programming: Python supports GUI applications that can be created and ported to many system calls, libraries and windows systems, such as Windows MFC, Macintosh, and the X Window system of Unix.
Web Development: support Web Server side programming using Django, Flask packages.
Scalable: Python provides a better structure and support for large programs than shell scripting.
OOP: It supports functional and structured programming methods as well as OOP.
Interpreted language: Python is processed at runtime by the interpreter. You do not need to compile your program before executing it. It can be used as a scripting language or can be compiled to byte-code for building large applications.
Dynamic data type: It provides very high-level dynamic data types and supports dynamic type checking.
Garbage collection: It supports automatic garbage collection and memory management.
Free and Open Source
Large standard libraries to solve common tasks like web:Django, Flask, Analytics:Pandas, NumPy, SciPy, Gaming:Pygame, Panda3D, GUI: Tkinter
Creating Prototypes: Python is slow compared to compiled languages like C++ and Java. Its not good choice if resources are limited and efficiency is a must.
Great Community and Support.
Good Language for beginner.
Pretty much anything you want: GUI application, Web development, Web Scraping, Data Analitics, System Administration, Game Development.
Python was conceived in the late 1980s, and its implementation began in December 1989 by Guido van Rossum at Centrum Wiskunde & Informatica (CWI) in the Netherlands as a successor to the language ABC .
Van Rossum chose Python as a working title for the project, being a big fan of Monty Python's Flying Circus.
|Van Rossum is Python's principal author, and is continuing central role in deciding the direction of Python. Python 2.0 was released on 16 October 2000.
Python 3.0 a major, backwards-incompatible release, was released on 3 December 2008 after a long period of testing.
Van Rossum wrote in 1996, Over six years ago, in December 1989, I was looking for a "hobby" programming project that would keep me occupied during the week around Christmas. My office would be closed, but I had a home computer, and not much else on my hands. I decided to write an interpreter for the new scripting language I had been thinking about lately: a descendant of ABC that would appeal to Unix/C hackers.
compiling python code
Python is Interpreted language. It is processed at runtime by the interpreter. Python source code is automatically compiled into Python byte code by the CPython interpreter.
You can run a python code (compile to byte code + execute byte code using interpreter)
To compile without executing the code, you can use the py_compile module:
Since your python file is byte compiled, you need to run it through the python interpreter
A drawback is that it doesn’t only compile the module, it also executes it, which may not be what you always want.
To compile a Python program into an executable, use a bundling tool, such as py2exe (Windows), cx_Freeze (cross-platform), py2app (Mac). These tools puts your modules and data files in an archive file, and creates executable.
The core philosophy of the language is summarized by the document The Zen of Python, which includes aphorisms such as:
Beautiful is better than ugly
Explicit is better than implicit
Simple is better than complex
Complex is better than complicated
Rather than requiring all desired functionality to be built into the language's core, Python was designed to be highly extensible.
To describe something as clever is not considered a compliment in the Python culture.
Python's philosophy is in favour of "there should be one—and preferably only one—obvious way to do it".
dynamic name resolution (late binding), which binds method and variable names during program execution.
Python is a multi-paradigm programming language: object-oriented programming and structured programming are fully supported.
This design of a small core language with a large standard library and an easily extensible interpreter was intended by Van Rossum from the start because of his frustrations with ABC, which espoused the opposite mindset.
Structured programming aimed at improving the clarity, quality, and development time of a computer program by making extensive use of subroutines, block structures, for and while loops.
The main Python implementation, named CPython, is written in C meeting the C89 standard. It compiles Python programs into intermediate bytecode, which is executed by the virtual machine. CPython is distributed with a large standard library written in a mixture of C and Python.
It is available in versions for many platforms, including Windows and most modern Unix-like systems. CPython was intended from almost its very conception to be cross-platform.
PyPy is a fast, compliant interpreter of Python 2.7 and 3.2. Its just-in-time compiler brings a significant speed improvement over CPython. A version taking advantage of multi-core processors using software transactional memory is being created.
Stackless Python is a significant fork of CPython that implements microthreads; it does not use the C memory stack, thus allowing massively concurrent programs. PyPy also has a stackless version.
MicroPython is a lean, fast Python 3 variant that is optimised to run on microcontrollers.
Jython compiles into Java byte code, which can then be executed by every Java virtual machine implementation. This also enables the use of Java class library functions from the Python program.
IronPython follows a similar approach in order to run Python programs on the .NET Common Language Runtime.
The RPython language can be compiled to C, Java bytecode, or Common Intermediate Language, and is used to build the PyPy interpreter of Python.
Shed Skin compiles Python to C++.
Cython and Pyrex compile to C.
useful modules, packages and libraries
SQLAlchemy- Object oriented access to several different database systems
Foreign Function Interface
CTypes- A package for calling the functions of dlls/shared libraries.
Cython- is an extension language for the CPython runtime. It translates Python code to fast C code and supports calling external C and C++ code natively.It requires a C compiler to translate the generated code.
PyGame - Principal wrapper of the SDL library.
GIS (Geographic Information System)
GIS Web services - Packages to access to Google Maps, Yahoo! Maps and more information
PyGtk - Bindings for the cross-platform Gtk toolkit.
PyQt - Bindings for the cross-platform Qt framework.
TkInter - The traditional Python user interface toolkit.
WxPython - wxWidgets bindings for Python supporting PythonCard, Wax and other frameworks.
PyjamasDesktop - Bindings and a framework for the cross-platform webkit.
Python Audio Tools
Python Imaging Library (PIL) - Supports many file formats, and provides powerful image processing and graphics capabilities.
pyqtgraph - Pure-python graphics library for scientific applications with image/video display, multidimensional image slicing, and interactive manipulation tools.
Indexing and Searching
asyncoro - Asynchronous, concurrent programming framework with coroutines with thread-like interface
Gevent - Coroutine-based network library
TwistedMatrix - Event-driven networking framework
RPyC - Transparent RPC/distributed-computing framework
PyRO - powerful OO RPC
HTTPLib2 - A comprehensive HTTP client library that supports many features left out of other HTTP libraries, like httplib on the standard library.
Celery - Distributed task queue for out of band processing/RPC and more.
Psyco - Psyco can speed up the execution of any Python code (x86 only).
PyInstaller - Packages Python programs into stand-alone executables, under Windows, Linux and Irix.
py2app - Creates stand-alone apps (like py2exe for Mac)
PyObjC - Bridge between the Python and Objective-C. Most important usage of this is writing Cocoa GUI applications on Mac OS X in pure Python
PyWin32 - Python extensions for Windows.
Py2exe - Converts python scripts into executable windows programs, able to run without requiring a python installation.
Chaco - Creates interactive plots
gnuplot.py - Based on gnuplot
Matplotlib - Production quality output in a wide variety of formats
Plotly - Interactive, publication-quality, web based charts
PyX - Postscript and PDF output, (La)TeX integration
ReportLab includes a charting package
Veusz - Postscript output with a PyQt front end
pyqtgraph - Pure-python plotting and graphics library based on PyQt and numpy.
http://docutils.sourceforge.net/docs/user/tools.html#rst2s5-py - Create HTML slides from .rst files
http://seld.be/notes/introducing-slippy-html-presentations - For your Python presentations in browser
Visual Python - Offers real-time 3D output, is easily usable by novice programmers, excellent for physics.
SciPy - Includes modules for graphics and plotting, optimization, integration, special functions, signal and image processing, genetic algorithms.
Python Bindings for R - R is a well known, open source (GPL 2) statistical package.
PyIMSL is a collection of Python wrappers to the mathematical and statistical algorithms in the IMSL C Numerical Library.
Standard Library Enhancements
Python Path - Wraps the functionality of the os.path module and provides something more convenient.
Requests - An improvement upon urllib etc., for sending HTTP requests.
Dateutil - Provides powerful extensions to the datetime module.
sh - Can call any external program as if it were a function.
DocOpt - Command line arguments parser, with declarative approach (docstring).
PyLibrary - Collection of Libraries useful for Python developers.
ThreadPool - Intuitive approach to threads, well-explained.
psutil - cross-platform library for retrieving information on running processes and system utilization (CPU, memory, disks, network) in Python.
Django - High-level web framework.
Pyramid - Turbogears, Pylons, Repoz.bfg merged as Pyramid.
TurboGears - Rapid web development megaframework.
Pylons - A lightweight web framework emphasizing flexibility and rapid development.
web2py - High-level framework for agile development.
Flask - microframework for Python based on Werkzeug, Jinja 2. (It's BSD licensed)
ClientForm - ClientForm is a Python module for handling HTML forms on the client side, useful for parsing HTML forms, filling them in and returning the completed forms to the server.
lxml.html - has support for dealing with forms in HTML documents
openflow - A workflow engine for Zope 2.
Goflow - A workflow engine for Django, with same design as openflow.
ElementTree - The Element type is a simple but flexible container object, designed to store hierarchical data structures.
lxml - is a very fast, easy-to-use and versatile library for XML handling that is mostly compatible with but much more feature-rich than ElementTree
Amara - Amara provides tools you can trust to conform with XML standards without losing the familiar Python feel.