Stage 3 gets you more practice on Python and some modules like webbrowser, turtle, os, time. And get familiar with Python class.
html scripts are written and stored as string variables:
- main_page_content: 4-level div
def create_movie_tiles_content(movies):use regular expression to search trailer_youtube_id and update the value in movie_tile_content.
def open_movies_page(movies):update main_page_content and write into “fresh_tomatoes.html”, use
webbrowserto open the file.
define a Movie class, with attributes of title, storyline, poster_image_url, trailer_youtube_url
This is what the student is supposed to finish. The easiest part.
media.Movie()to initialize 3 instances
To run it, put all python files in one directory, open terminal:
It then generates a html and opens it in a browser. If you click on the movie icon, it starts to play. It is pretty cool. However, github is not able to host a displayed HTML. Instead, I host it in my AWS: https://s3-us-west-2.amazonaws.com/jychstar/fresh_tomatoes.html