Python: An introduction

The objective of this post is to present a quick introduction to the Python programming language.


Python is a very easy to use language, which is why I like to use it to develop programs for quick proofs of concept (for example, creating a simple server or opening a socket to communicate with a ESP8266).

One big advantage of Python is that there are lots of libraries and modules that offer us easy to use functionalities, a little bit like we have in Arduino.

To install Python, just go here, download the installer and run it (assuming that you are using Windows, if you are on Linux you can also easily install Python from the command line). The differences between versions 2.x and 3.x are explained here.

You can also run some Python code online here, to test the language before installing.


Python IDE

Python comes with a simple IDE called IDLE. After installing Python, search for IDLE and run it. You should see a window similar to the one in figure 1.


Figure 1 – IDLE Python shell.

As seen, IDLE presents the Python shell by default, where you can send commands.


Hello World

As stated before, Python is a very easy to use programming language. So, to output the famous “Hello World” sentence, you can just type the following in IDLE, in the shell, and press enter:

print (“Hello World”)

The string in quotes will be printed in IDLE’s command line, as shown in figure 2.

Python hello world

Figure 2 – Hello World in Python.

This is very simple compared to, for example, Java, where you would need to write something like:

System.out.println(“Hello World”);

Or in C, where you would have to write something like:

printf(“Hello World”);



For more complex programs, it’s easier to write all the code in a file (or multiple files) and run it at once, instead of writing the commands one by one in the command line.

To do it in IDLE, we just go to File -> New File, as shown in figure 3.


Figure 3 – Opening a new scripting file.

In the new window, we just write our code and then click Run -> Run Module, as shown in figure 4.


Figure 4 – Running the script.

For the print(“Hello World”) code, the same “Hello World” sentence should be printed in the shell of IDLE.



One of the big advantages of Python is the big number of libraries/modules available that implement very different functionalities and are easy to install and use. Bellow, there’s a list of some interesting ones:

  • OpenCV: Computer vision library;
  • NumPy: Scientific computing library;
  • ScyPy:  A library for mathematics, science and engineering;
  • Django: Web framework for rapid development;
  • Bottle: Micro web framework;
  • Flask: Micro web framework. Check this post for an example IoT application using it;
  • Scrapy: Web crawling framework;
  • Tkinter: A library for GUI design;
  • SQLAlchemy: Object relational mapper for Python.

You can check some other useful modules here. There are plenty of libraries around the web, it’s just a matter of doing a quick search before starting to implement something from scratch, since it’s probable that someone has already created a library in Python for that.

In order to install new python libraries the easiest way is using pip, which is a very easy to use command line installer. Installing libraries with pip usually only requires a command like pip install libraryName.


10 Replies to “Python: An introduction”

  1. Pingback: techtutorialsx
  2. Hi antepher! I love Python as well. Seems like your using an out of date version of Python. Upgrade to the latest version of Python 2 at You can also get Python 3. Get it at Cheers! Epic Chas Gamer 😀

    Liked by 1 person

  3. Hi again antepher! Good luck with your blog! When I said you are using an out of date Python 2, I mean there is a mini update to Python 2: 2.7.9. I think it is just a bug fix update, but it is worth it. Cheers! Epic Chas Gamer 😎

    Liked by 1 person

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s