Let's talk about Python

I've started learning Python less than two weeks ago. And I really love it. I want to share my thoughts about it and write tutorials that may help other developers like me in their daily coding time.

The official logo

Python is an object-oriented, high-level, interpeted programming language. It was created by Guido Van Rossum in 1991 and has got a very simple syntax that is easy to learn and remember.

It supports various data structures like lists, sets, dictionaries and tuples; the code is organized in modules and packages, which encourages program modularity and code reuse. On GitHub it occupies the third position in the Top languages list.

At this time there are two supported Python version: 2.7.x and 3.7.x. The active support of the first one will end in January 2020.

Hello World example

This is a dead simple Hello World program:

There are plenty of modules and packages developed by the active Python Community, that can help you with your projects or job. One of the best source is the Python Package Index (PyPI)

Some cool practical things you can build in Python

Two weeks ago I asked myself: "What could I build with this language?" and I found these things:

Web Development

You can obviously develop a website or a web application: I've created a simple web app that manage my nutrition and workout plan, so I can see and track my results along a period of time. For this project I used Django, a web framework build in Python.

I'm currently working on a Telegram Bot that will send me a Canto of the Divine Comedy every single day for 33 days. Google, Instagram, Facebook, Reddit and other giant companies use Python in their infrastructure.

Other web framework are Pyramid and Flask. I'll give them a try as soon as possible. You can create your personal website in no time, an e-commerce or even a poker platform.

Data Analysis and calculus

With the SciPy software you can get really useful Scientific Computing Tools for numerical computation, data analysis, a collection of algorithms for image processing, algorithms and tools for machine learning and so on.

Automate repetitive tasks

Two days ago a client sent me ten giant CSV files with hundreds of thousands of books information. Every row was a single book and every book had the same number of fields. I created a simple script in 15 minutes, that opened each file and processed it in the same way as the others: "check the correct number of fields, the correct sequence of fields, the syntax, the separator, etc. and write every error in a dedicated log file.". The execution time was around 6 seconds for each file. I saved a lot of time.

I'll add other things in the next weeks, after some deep researches and tests. If you have questions or if you just want to share your experience, let's talk on Instagram or Telegram.