Рус Eng During last 365 days Approved articles: 2053,   Articles in work: 307 Declined articles: 852 
Articles and journals | Tariffs | Payments | Your profile

Back to contents

Practical use of asynchronous programming in Python with Asyncio
Savostin Petr Alekseevich

Bachelor's Degree, Department of Algorithmic Languages, Lomonosov Moscow State University 

117437, Russia, g. Moscow, ul. Leninskie Gory, 1, str. 52
Efremova Natalya Ernestovna

PhD in Physics and Mathematics

Assistant, Department of Algorithmic Languages, Lomonosov Moscow State University

119234, Russia, Moskovskaya oblast', g. Moscow, ul. Leninskie Gory, 1, str. 52, aud. 707


The subject of the study is the study of the basic principles of asynchronous programming with the Asyncio package and their application for solving applied problems in Python. Since the Python interpreter uses the Global Interpreter Lock synchronization method, which limits the ability to parallelize programs in the given language and, as a result, does not allow achieving the greatest efficiency, the use of asynchronous programming technologies allows to significantly increase the speed of programs in this language, avoiding the mentioned limitations. The above described approach to creating programs is used in many tasks, for example: when creating a web server, client-server application, when extracting data from a resource by a web crawler. This paper is devoted to explaining the basic principles of working with the packageAsyncio in Python. Since the Russian-language literature on this package is often not enough to understand the basics of asynchronous programming in Python, this article gives examples of the use of this technology with explanations.

Keywords: scraping, couroutines, parsing, web-crawling, asynchronous programming, asyncio library, python programming language, GIL, parallel computing, data extraction



Article was received:


Review date:


Publish date:


This article written in Russian. You can find full text of article in Russian here .

Applications written in Python [Elektronnyi resurs]. – Elektron. dan. – URL: (data obrashcheniya: 25.03.2018).
Asyncio documentation [Elektronnyi resurs]. – Elektron. dan. – URL: (data obrashcheniya: 25.03.2018).
Python [Elektronnyi resurs]. – Elektron. dan. – URL: (data obrashcheniya: 08.02.2018).
Zhurnal Tproger [Elektronnyi resurs]. – Elektron. dan. – URL: (data obrashcheniya: 25.03.2018)
Donal'd Knut. Iskusstvo programmirovaniya, tom 1. Osnovnye algoritmy = The Art of Computer Programming, vol.1. Fundamental Algorithms. – 3-e izd. – M.: «Vil'yams», 2006. – S. 720. – ISBN 0-201-89683-4.Razdel 1.4.2: Soprogrammy, str. 229-236.
Sammerfild M., Programmirovanie na Python 3. Podrobnoe rukovodstvo, 2009.