English subtitles

← Designing the Movie Website - Programming Foundations with Python

Get Embed Code
7 Languages

Showing Revision 8 created 09/10/2017 by Dejan Trajkovic.

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