From the course: Skill Up with Python: Hands-On Web Development Projects
Unlock this course with a free trial
Join today to access over 24,400 courses taught by industry experts.
Make network requests - Python Tutorial
From the course: Skill Up with Python: Hands-On Web Development Projects
Make network requests
- All right, so the first thing that we're going to need to know how to do in this project is make network requests from inside a Python program, because so far we've been making network requests, but all of those have been coming either from Postman or from our browser, right? This is how we've actually been making the requests and the actual handling of those requests has been pretty much all we've been defining in flask. So we're going to need to switch gears here, of course. And we're not actually going to create a flask project like we've been doing. We're just going to start off by creating a new folder and we'll call this something like Weather App. And inside here we'll create a new file, which we'll call something like Get-Weather.py. Alright? So the first thing, as I said that we're going to need to know how to do is make a network request from inside a Python program. Now, Python actually provides us with a pretty easy way of doing this by using the requests library. And…