Python: The Big Picture

Python is a general‑purpose and high‑level programming language. Algorithms + Data structures = Programs

Python is an interpreted programming language - it's like having a live translator translating your code into the language the CPU understands in real time. In compiled languages like C++, Java, C#, the code has to be changed into instructions that the CPU understands.

Python does not have a C‑like syntax. In languages like C and C ++, whitespace doesn't actually have a significant meaning. In Python, however, related blocks of code are grouped based on how far they are indented, making the whitespace quite significant. 

Python is a multiparadigm programming language. It supports structured programming, object‑oriented programming, and functional programming.

Python is a dynamically typed programming language - the type of a variable can change over the lifetime of that variable and type checking happens at runtime. Most statically typed languages are compiled languages

Python handles garbage collection. The helps in avoiding tedious memory bookkeeping, common memory leaks, preventing whole classes of security issues and efficiently implementing certain persistent data structures. Many programming languages like C and C++ require the programmer that wrote the program to clean up the data in memory which the program operates upon. In most modern languages, like Python, C#, and Java, the language and its runtime will take care of cleaning up the memory. This automatic cleanup is what is known as garbage collection. 

Some of the Python principles (from Python Enhancement Proposals, PEP 20 - The Zen of Python):

  • Beautiful is better than ugly
  • Explicit is better than implicit.
  • Readability counts
  • Errors should never pass silently.
  • Unless explicitly silenced.

Pros & Cons

  • Comprehensive Standard Library
  • Community-driven
  • Third‑party libraries - Python Package Index, or PyPI is where people often publish their Python code to so it can be used by others

Python Drawbacks - 

  • Interpreted hence slow compared to languages like C, C++ or Go
  • Not Native resulting in high‑memory usage in several cases, and lacking a native security sandbox
  • Dynamic language - due to the absence of a compiler, errors primarily occur at runtime where they can be more difficult for developers to diagnose

The Pip tool comes installed by default with many Python distributions and installs. Installing packages with pip is as simple as executing pip install, followed by the package you want to install. Pip helps to install and uninstall Python packages, ensure we're using the right versions of third‑party libraries track our own dependencies and also by installing and uninstalling the dependencies of the packages we're installing into our project. We can track a group of Python packages as a package group. This allows us to install, uninstall, and otherwise manage the package group as a single unit. 

Python Frameworks:

API

  • Flask
  • Bottle
  • Pyramid

Website

  • Django
  • TurboGears
  • web2py

App (CMS, ERP)

  • Plone
  • django-cms
  • Mezzanine

Popular Third-Party Libraries

  • Data Science - NumPy, Pandas, Matplotlib, Tensorflow, Keras, Scikit Learn
  • Web Development -  Flask, Requests, Django
  • Images / Computer Vision - Pillow, Pygal, OpenCV, Mahotas
  • Applications - wxPython (GUI), PyGTK (GUI), Fire (CLI), Kivy (Mobile/Multi-touch), Pygame

Python IDEs and Editors:
  • Pydev
  • Pycharm
  • Visual Studio Code
  • Spyder
  • Sublime
  • Vim
  • GNU/Emacs
Jupyter Notebook aids in interactive programming 

References:

Core Python: Big Picture [Updated: Mar 2, 2021, Duration: 48m]

W3Schools.com/Python

0 Comments