Simply download all three files and unzip in a same folder.
Then, input the code in your terminal:
$ cd {PATH OF YOUR FOLDER}
$ python entertainment_center.py
For example:
$ cd /Users/Admin/Movie Website
$ python entertainment_center.py
You should see the website contains the movies in the opened browser window.
-
media.py
: Contains the definition of theMovie
class. -
fresh_tomatoes.py
: contains theopen_movies_page()
function take the list of the instances of theMovie
class as arguments and generate the HTML file based on the content of the instances. -
entertainmnet_center.py
: The main source file which create the instances and put them in a list. Then, it call the open_movies_page() function to generate the HTML file. -
fresh_tomatoes.html
: The HTML file generated by the source code, which will be displayed by browser. (Not necessary for the program running)
- Python is installed on your computer, if not, install python.
- A web browser is necessary to open website (The HTML file). Google Chrome is recommended.
- The year of the movie and the story line will be rendered in the HTML file and be displayed under the title of the each movie on the website.
MIT
Yunfan Niu