Articles about Python

Python Logo

Python is one of the most versatile programming languages in the world. With Python, you can control electronics, build web applications and perform machine learning.

In this page, you can find articles on Python references, coding and application setup.

How to setup Python Imaging Library, Pillow, on Raspbian Stretch Lite for processing images on your Raspberry Pi

When you are building a Raspberry Pi project that deals with images, the Python Imaging Library, Pillow can be very useful. For example, if you connect a camera to your Raspberry Pi 2 or 3 and took a picture, you may want to resize the picture before sending it to a server endpoint.

In case you have trouble setting up Pillow on Raspbian Stretch Lite, this post is for your reference.

Programming languages that you can use to build applications for Raspberry Pi, via Raspbian Stretch Lite

A programming language give programmers an interface to create computer applications to serve different use cases. On the other hand, a Raspberry Pi is one of the things that a programmer should consider getting.

Raspbian Stretch Lite is the official operating system for programmers to run server applications on a Raspberry Pi. You can use Raspbian Stretch Lite for applications that do not require a graphical user interface.

So what programming languages can you use for building applications for Raspbian Stretch Lite?

This post discusses some programming languages that you can use for building applications for Raspbian Stretch Lite.

How to setup Jupyter Notebook on Raspberry Pi 3 with Raspbian Stretch Lite, Supervisor and Virtualenv to run Python 3 codes

By taking Andrew Ng’s Deep Learning Coursera course, you can get a better understanding of deep learning. In addition, you will also get many Jupyter Notebook documents that you can reference to build models that can solve interesting problems.

In order to readily access these documents, you may want to setup Jupyter Notebook on a single board computer like the Raspberry Pi 3. With this in mind, this post shows how you can setup Jupyter Notebook on Raspberry Pi 3 with Raspbian Stretch Lite, Supervisor and Virtualenv to run Python 3 codes.

How to setup Taiga project management platform on Raspberry Pi 3 with Raspbian Stretch Lite

Taiga and Raspbian icon

A project management platform is useful for us to keep tabs on what we want to build. Taiga is a popular open source project management platform that is highly recommended by opensource.com to be the top open source alternative to Trello.

Taiga runs well on a Raspberry Pi 3. If you want to setup something at home to help you manage the projects that you are working on, you can consider setting up the Taiga project management platform on a Raspberry Pi 3 with Raspbian Stretch Lite as the base operating system.

This post is adapted from Taiga’s installation guide to serve as a guide to setting up Taiga project management platform on Raspberry Pi 3 with Raspbian Stretch Lite.

How to paginate MongoEngine records in your Python 3 Flask application

Flask and MongoEngine help makes development work easier.

One common task in the development of backend applications is the pagination of database records. Without pagination, the application server can run out of memory while generating a response from the database records.

This post discusses a way to paginate MongoEngine records in your Python 3 Flask application using the facilities provided by the Flask-MongoEngine extension.

How to deploy Python 3 Flask application on Raspberry Pi 3 with Raspbian Stretch Lite, Nginx, Supervisor, Virtualenv and Gunicorn

Raspberry Pi 3 Model B boards make good gifts for programmers and if someone had gifted you with one, you may want to use it as a control center for interacting with various IoT sensors and devices at home.

In such a situation, you may want to build a Python 3 Flask application to present the web interface for accessing the control center.

After you had built that Python 3 Flask application, the next step will be to deploy it on your Raspberry Pi 3 for serving HTTP requests.

This post discusses how you can deploy a Python 3 Flask application on Raspberry Pi 3 with Raspbian Stretch Lite, Nginx, Virtualenv and Gunicorn.

How to setup Raspbian Stretch Lite on Raspberry Pi 3 to run Python 3 applications

Raspbian Stretch Lite operating system is the Raspberry Pi Foundation’s official supported operating system for running headless software. It is a good operating system for different Raspberry Pi 3 use cases. Some examples include:

If you are planning to use Raspberry Pi 3 GPIO to interface with the real world, it is recommended that you setup Raspbian Stretch Lite to run Python 3 applications.

This post provides the steps to setup Raspbian Stretch Lite on Raspberry Pi 3 for running Python 3 applications.

How to enable authenticated MongoDB access for Flask-MongoEngine applications

After having a first look at MongoDB more than 5 years back, I told myself that I will use MongoDB to realise the next functionality of Techcoil.

With exposure to Python 3, Flask and MongoEngine in 2017, I had acquired the skills to build a microsite to recommend gift ideas. This microsite uses MongoDB to store the gift recommendation data.

With Flask and MongoEngine, development of this microsite did not take too much leisure time. With MongoDB not enforcing authentication, there were not much hindrance in setting up the development environment for this microsite.

However, this free-for-all mode of accessing MongoDB is not recommended for production environments. Without authentication, it is easier for ill-intentioned people to mess up the backend database.

To ensure that I have a go-to post for implementing authenticated access to MongoDB backed projects in the future, I document the steps needed for Flask-MongoEngine applications to access MongoDB instances with access control turned on.