Python Jumpstart by Building 10 Apps Transcripts
Chapter: App 5: Real-time weather client
Lecture: App start

Login or purchase this course to watch this video and the rest of the course contents.
0:00 Well, let's create our application, our project, to build our weather client here. We're gonna say "new project",
0:07 and we're gonna create it in the "weather_client" folder on my desktop,
0:10 then I'll move it into the GitHub Repository. It's gonna be using the Python 3.9 interpreter, just the system one for now,
0:15 we'll talk about what that means in a minute, and I'm not gonna use this main script, welcome script,
0:21 that PyCharm just added to its functionality for new projects. Over here we have our empty project and I'm gonna add,
0:28 as we do for all of these, a new Python file and we'll call it "program". Then just to get the little button lit up here,
0:34 let's go ahead and, once it's done indexing, right click and say Run. Run it, and of course it does nothing,
0:41 but you can see it's now ready to run with the hotkeys or with that little button there. So what are we going to do in our program?
0:47 Let's just write these out as steps. Well, we're going to show the header and we're gonna get the location requests, or
0:55 the city, where do you want to get the weather for. We're gonna convert what they type
1:00 in into more useful data. What they're going to type is something like, they're gonna enter, you know, maybe Portland,
1:07 Oregon as a whole single string here. And what we want to know is both Portland is the city, and Oregon is the state,
1:13 and the default is that the country is the United States or something like that.
1:18 So we're gonna convert plain text over to data we can use. Once we have that data
1:25 for the city and the country and state and all those sorts of things, we can get the report from the API, the actual weather API that we're
1:33 going to use, and then the last thing, we're gonna report the weather. What we're gonna get back from the API
1:38 is structured data, and we want to take pieces of that data and turn it into something that's friendly to humans.
1:44 Like "the weather is gonna be 57 degrees and sunny", Not "here is some data structure that the API returned".
1:50 So that's what this last thing here is going to be about. So these are the steps that we're gonna have to take to build this simple application.

Talk Python's Mastodon Michael Kennedy's Mastodon