What is Python?
Python is a flexible and powerful programming language, which sees use in a great variety of fields, from both commercial and academic realms.
Python is open-source, free to use, and is arguably one of the easiest major programming languages to learn, with readable code being one of the core goals of the project.
In addition to code being easy to understand and maintain, it also includes a great deal of useful functionality out of the box, in its extensive standard library.
Python is also easily extendable, with access to thousands of third party modules and packages for nearly any computing task imaginable – these are easily found and installed using the Python Package Index (PyPI) and tools like `pip`, which since version 3.4 has been included with Python. []
It is also very popular: Python can be understood and maintained by a large set of developers, which continues to grow faster than for any other major language at the time of writing.
We will expand upon these points in the following sections, but first, let’s look at Python’s history.
Why use Python?
The main selling points for Python, explored in the following sections, are:
- Its power and flexibility
- Its clarity, simplicity and elegance
- Its ease of maintenance
- Its popularity and widespread use
What is Python used for?
Python offers a simpler route into programming than its main competitors, C, C++ and Java, with more readable and intuitive code. It takes comparatively less time to develop Python code, and the end result tends to be easier to maintain, due to its clarity.
Python supports multiple different programming style/paradigms, fully supporting both object oriented and structured programming, and also has some support for functional programming.
Famous modules and implementation areas:
It ships with an extensive standard library []: Python comes with many built-in features that allow it to be used for most programming tasks, for example:
- Powerful built-in data types, including lists, associative arrays (dictionaries) and fully object-oriented classes
- Extensive text processing functions, including regular expressions, string and Unicode functions
- unit testing
- simple GUI functionality (Tk)
- file compression and archiving, compatible with zip, gzip, bzip2, tar
- Handling a multitude of common data formats, including:
- CSV, JSON and INI file reading and writing
- HTML, XML, MIME parsing
- Internet, networking, SSL, sockets
- Threading/Multiprocessing support
- Database connectivity
It is easily extensible with third party packages
- As mentioned previously, one can use
pipto easily install and manage packages from PyPI [], which cover a multitude of useful extensions to the language. Thousands of packages are available, covering a wide range of use cases and disciplines. Notable examples include:
- NumPy, SciPy and Matplotlib: Extremely efficient multi-dimensional array storage, manipulation and visualisation. Extensively used scientific computing, for example in machine learning and Big Data applications
- Pillow and OpenCV: Image processing, very useful for handling image files, computer vision, robotics, etc.
- wxPython and PyQt: Easily build more advanced GUI applications in Python
- requests: Easy HTTP (web) requests from the internet or your local network
- CherryPy: Easily set up a web server from any machine