Python Notes (0.14.0)

Why using Python

Easy to Learn

As you will see, Python is extremely easy to get started with. Python has a simple syntax, yet powerful enough for most applications.

Simple but powerful

The language has an easy and clean syntax with simple semantics. Similar to C, Algol but it is also an OOP language; OOP is not mandatory (unlike CPP). No extra symbol to start or end a statement (no @, $ symbole like in perl); No special character at the end (like ; in C).

The hello example is as simple as

print("hello")

Quick to start with

The main reasons being:

  • no declaration required. It is a high-level language
  • many built-in data structures are already available: dictionary, lists...
  • no need for memory handling: there is a memory garbage collector

Interpreted

Python can be run, debugged and tested interactively in the python interpreter.

MultiPlatform and portable

Byte code can be executed on different platforms.

Battery included

  • Many modules are already provided by default to handle HTML, HTTP, GUI, databases. Ideal for web scripting and data handling.
  • There is a rich set of external libraries especially for science (matplotlib, pandas, networkx)

Extensible and flexible

  • Python can be used to connect many applications or separate software components in a simple manner.
  • scalable: support large program thanks to a better structure and support than standard script languages. Provide tools to build modular application with modules, packages but also GUI interface
  • large program can be organised into smaller modules that can still interact with each other or built-in modules

Drawbacks

  • indentation probably intimidates beginners but after a couple of hours of coding it becomes natural.
  • slower than compiled languages.