engineering

April 30, 2020   |   5min read

What Is Python Used For? Most Popular Uses

Introduction

What do companies like Google, Facebook, or Netflix have in common? All of them use Python programming language. It was created in 1991 by a Dutch student Guido Van Rossum. And its name was not derived, as you may probably assume, from tropical snakes, but from British comedians’ group—Monty Python. Due to this fact within language itself and across the books about Python you can find a lot of references to gags made by our British fellows (“spam and ham”, instead of “foo and bar”). But why are we talking about this language? Python has been growing steadily for many years to become one of the most popular programming languages. Why did it become so popular? Here is a list of some of the advantages:

  • It’s friendly and easy to learn for both fresh and experienced programmers. It is easy to grasp main programming concepts when using Python; however, extending the scope of its application seems almost unlimited.
  • It’s open-sourced and provides excellent community support. A great global and active community of people passionate about it has grown over the years.
  • It’s a productive, more verbose, and expressive language. It also requires much less effort, time, and lines of code to perform the same operations it would take in C++, for example.
  • It runs everywhere. Systems like Linux and macOS have Python onboard by default and Microsoft has recently significantly improved support for it. It also runs on servers, cloud, and IoT devices.

The guiding principles of Python design are presented in the form of aphorisms called the “Zen of Python.” Among other things, Zen says: “Beautiful is better than ugly” and “Simple is better than complex,” which emphasizes that the simplicity of implementations shall be kept as well.

But Python is not ideal. One of the main allegations against Python is that it is not as fast as languages like C++, but in many cases, performance differences are not visible. Moreover, because computer power is getting cheaper, it seems that this difference is not so significant. Especially (in instances) where rapid delivery and maintenance are more important. As one of the Googlers decided one day: “Python where we can, C++ where we must.” It may not be the best choice for mobile apps where native solutions are much more relevant. However, Python, with its great frameworks, may be a great choice for mobile apps backends. And if you are thinking of dabbling in machine learning, Python is also a good way to go.

What is Python used for?

In 2019, JetBrains, a company whose tools target software developers, conducted a “Developer Ecosystem Survey”. The results show what the main applications of our beloved Python are.

A chart showing what is Python used for Source

Let’s focus on the most popular ones:

  • Web development
  • Data analysis / Machine learning

Web Development

Python offers plenty of frameworks that can help build web applications, but Django and Flask are two of the most popular ones.

  • Flask is a microframework that gives a lot of freedom in customizing your app. Despite being started as an April Fool’s joke, it has become quite popular. It is suitable for small and medium apps, widely used in a microservices architecture.
  • Django is a powerful framework for building fully-featured complex web apps. It consists of dozens of solutions for common web development tasks. It is fast, secure, and easy to scale, which makes it a great tool for building business applications.

If you want to learn more about differences between these two frameworks our experienced engineer Dariusz wrote an article comparing them: Flask vs. Django—Choosing the Best Framework for Web Development

Data analysis / Machine learning

Nowadays, there is an explosion of data to be processed with many data analysis methods. The need for data has grown tremendously, which leads to the creation of new sectors in IT. How to handle massive data volumes to get meaningful results? How to use this data in machine learning for predictions and what data analysis methods to use? Luckily, Python is a great choice to jump into the field of machine learning as it offers a bunch of libraries that can help with these kinds of tasks. Let’s take a look at a few of them:

  • Numpy - supports arrays, matrices, and high-level mathematical functions to operate on them
  • Pandas - library for data structures, manipulation, and analysis
  • Matplotlib - comprehensive 2D/3D plotting
  • Scikit Learn - provides a range of machine learning algorithms
  • Tensorflow / PyTorch - machine learning frameworks

If you want to learn more about basic data analysis there are plenty of data analysis methods guides available, but our experienced software engineer Kasia wrote an excellent article about it: Data Analysis Methods Guide.

A significant part of data scientist work is to operate on data and manage pipelines that perform operations on it. There is a particularly useful tool dedicated to it called Apache Airflow, which is entirely written and manageable in Python.

Other applications

Let’s take a glance at some of the other language applications:

  • Automation - convenient way of parsing files, communication with REST APIs, scraping websites, and interaction with Operating Systems - a perfect language for automating tasks.
  • Education - thanks to simplicity, verbosity, and interactive environment, it is a great way to teach different programming paradigms.
  • Embedded - you can use Python on microcomputers like RaspberryPI or on microcontrollers with the help of MicroPython implementation.
  • Desktop- libraries like wxWidgets, Kivy, Qt allow you to create some GUI applications.
  • Games- games like The Sims, Battlefield or Sid Meier’s Civilization IV employed Python. A popular set of Python modules called PyGame allows you to create fully featured games and multimedia programs.

Summary

Python is used everywhere. Mostly due to its simplicity and speed of development. Its popularity is steadily growing, and it is worth considering using it in your future projects.

If you have any questions regarding the development of web-based applications or have a project in mind, don’t hesitate to contact us.

Tobiasz Kędzierski

Software Engineer

Did you enjoy the read?

If you have any questions, don’t hesitate to ask!