Building Python applications that have graphical user interfaces and are doing sophisticated tasks might look difficult. In a recently published article (see the link below), I mentioned how only 7 Python libraries are needed to start building applications.

Build Your First Data Science Application

This article will show you how to build a simple translation application in a few lines. I only use two Python libraries: requests and ipywidgets.

Basics

I chose to write a translator application as an example to show you how it is easy to build applications in Python. This application gets an English text and shows its Spanish translation. Very easy and straightforward.

To do so, we need two parts inside the application. The first part is a backend that does the translation, and the second part is a frontend or a graphical user interface (GUI) that interacts with the user (taking the input text and showing the output text).

For the backend, I use Azure Translation API. If you are not familiar with the concept of API (Application Programming Interface), I try to explain it in an effortless way. An API is a way (i.e., protocol) to ask a service (for example, translation) from a service provider (usually a server). For example, you can use Google Maps API to get the driving distance between two locations. Imagine, if Google Maps API did not exist, then you should write your own code to calculate this driving distance based on roads databases. Simply, APIs prevent you from reinventing the wheel. Sometimes third party APIs are free, but most of the time, you must pay a little bit of cost (especially if you are using them frequently). For this article’s purpose, we use Microsoft Azure Translator API, which is free for limited use. If you don’t have an Azure account, please read the next section; otherwise, you can skip it.

#programming #data-science #python #technology

A Quick Way to Build Applications in Python
4.00 GEEK