Skip to content

Commit c6af7f0

Browse files
committed
Create an a class, Instances, Constructor, self, instance variables, instance methods
1 parent 6c5dd2c commit c6af7f0

File tree

3 files changed

+26
-0
lines changed

3 files changed

+26
-0
lines changed

movie_website/__init__.py

Whitespace-only changes.

movie_website/entertainment_center.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
from movie_website import media
2+
3+
toy_story = media.Movie("Toy Story",
4+
"A story of a boy and his toys that come to life",
5+
"https://upload.wikimedia.org/wikipedia/en/1/13/Toy_Story.jpg",
6+
"https://www.youtube.com/watch?v=JcpWXaA2qeg")
7+
8+
print(toy_story.storyline)
9+
10+
avatar = media.Movie("Avatar",
11+
"A marine on an aline planet",
12+
"https://upload.wikimedia.org/wikipedia/en/b/b0/Avatar-Teaser-Poster.jpg",
13+
"https://www.youtube.com/watch?v=EzETGqZN6dU")
14+
print(avatar.storyline)
15+
16+
avatar.show_trailer()

movie_website/media.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import webbrowser
2+
class Movie():
3+
def __init__(self, movie_title, movie_storyline, poster_image, trailer_youtube):
4+
self.title = movie_title
5+
self.storyline = movie_storyline
6+
self.poster_image_url = poster_image
7+
self.trailer_youtube_url = trailer_youtube
8+
9+
def show_trailer(self):
10+
webbrowser.open(self.trailer_youtube_url)

0 commit comments

Comments
 (0)