Return to Video

Designing the Movie Website - Programming Foundations with Python

  • 0:00 - 0:03
    So now that we've learned, a bunch of new words
  • 0:03 - 0:06
    related with classes and objects, we will move on to
  • 0:06 - 0:09
    creating a movie website. And here is the final output
  • 0:09 - 0:12
    that we are after. All of our favorite movies, on a
  • 0:12 - 0:15
    web page. And as you have seen previously, if you
  • 0:15 - 0:18
    click on anyone of these movies, we see its trailer.
  • 0:18 - 0:21
    Let's build this. So here I am, back with my
  • 0:21 - 0:25
    code. Now thus far, we've made only two movie objects. Toy
  • 0:25 - 0:29
    Story and Avatar. I'm going to make a few more.
  • 0:29 - 0:32
    In fact, four more movie objects. But before I do
  • 0:32 - 0:34
    that, I want to make this window, a little bit
  • 0:34 - 0:37
    bigger, so we can see all of this code really easily.
  • 0:37 - 0:40
    Okay. So here are the two instances we have created
  • 0:40 - 0:44
    thus far. Toy Story and Avatar. Now before I proceed, I
  • 0:44 - 0:47
    will go ahead and comment ou the previous output statements
  • 0:47 - 0:50
    that I created. This print statement and the show trailer method.
  • 0:50 - 0:52
    So let me just add a comment there,
  • 0:52 - 0:56
    [SOUND] and there. Done. Now, I'm going to add
  • 0:56 - 0:59
    a new movie object, for a movie called, School
  • 0:59 - 1:02
    of Rock. There it is. You will notice, that
  • 1:02 - 1:04
    I have changed the name of the movie,
  • 1:04 - 1:08
    its story-line, its poster image, and its future trailer
  • 1:08 - 1:12
    values appropriately. Next, I will add another movie object.
  • 1:12 - 1:16
    This time, for an animated movie called Ratatouille. Next,
  • 1:16 - 1:18
    I will add a movie object called, Midnight in
  • 1:18 - 1:21
    Paris. Now this, happens to be one of my
  • 1:21 - 1:24
    favorite movies. And the final movie object I will
  • 1:24 - 1:27
    add, is for a movie called, the Hunger Games.
  • 1:28 - 1:31
    Okay, so thus far, we have created six movie
  • 1:31 - 1:34
    objects. So far, so good. Now, to turn this
  • 1:34 - 1:36
    into a movie website. You will need a piece
  • 1:36 - 1:40
    of code that we wrote. Now we call this code,
  • 1:40 - 1:43
    fresh_tomatoes.py. By the way, this file is available
  • 1:43 - 1:45
    for you to download in the instructor notes. Now
  • 1:45 - 1:47
    before we use it, let's see what this
  • 1:47 - 1:52
    file actually does. This file, fresh_tomatoes.py, has a function
  • 1:52 - 1:56
    inside it called, open_movies_page. Let's look at this
  • 1:56 - 1:59
    function a bit more closely. Now, what this function
  • 1:59 - 2:01
    does, is that it takes in, a list of
  • 2:01 - 2:05
    movies as input, and as output it creates and
  • 2:05 - 2:08
    opens an HTML page or a website, that shows
  • 2:08 - 2:11
    the movies you gave it in the first place.
  • 2:11 - 2:13
    So what I'm going to do next, is use
  • 2:13 - 2:16
    this file, fresh_tomatoes.py, and it's
  • 2:16 - 2:18
    function, open_movies_page, inside our code.
Cím:
Designing the Movie Website - Programming Foundations with Python
Leírás:

more » « less
Video Language:
English
Team:
Udacity
Projekt:
UD036 - OOP
Duration:
02:19

English subtitles

Felülvizsgálatok Compare revisions