asyncio Sample Project Setup
In this lesson, you’ll start a sample project to demonstrate Async IO. You’ll see how to install aiohttp
, a blazingly fast async HTTP client/server framework.
00:00
Let’s start by getting our prerequisites out of the way. The first thing I want to do is create a directory called asynchrony
, which is going to be the name of my project folder.
00:17
So that created the directory, and then I cd
into it. The next thing I want to do is create two files that I’m going to be using in this project. One’s called theory.py
and the other one is called summer.py
.
00:38
And so, yeah, here’s these two files, summer.py
and then theory.py
and they’re both 0
size. And then finally, the last thing I want to do, as far as prereqs are concerned, is install a Python package for making asynchronous web requests, or HTTP requests.
00:55
This package is called—and I’m going to pip install
this. So I’m going to say pip install aiohttp
. This stands for Asynchronous IO HTTP.
01:07
This allows us to make web requests from within a Python program. So let’s go ahead and pip install
that.
01:15
Now that we have this package installed, we have our files created, we have our directory created—we’re basically ready to go. So let’s go ahead and open up our text editor. In my case here, I’m using VS Code, so I’m going to say code
dot (.
).
Become a Member to join the conversation.