I wrote the following code to run the trailer of a movie as part of a Udacity course. The code runs fine on python2.7 and shows the trailer in default browser I but get the following error when running the same code under python3. I was wondering if someone can point out how to make my code python3 compatible. I have removed some of the links in my code since I do not have 10 reputation points yet. Thanks.
Error in python 3:
AttributeError: 'Movie' object has no attribute 'show_trailer'
file media.py contains the class media and the method show_trailer
def __init__(self, movie_title, movie_storyline, movie_poster, movie_trailer, movie_review):
self.title = movie_title
self.storyline = movie_storyline
self.poster_image_url = movie_poster
self.trailer_youtube_url = movie_trailer
self.review = movie_review
file entertainment_center.py is being called (returns error under python3but works fine with python2.7)
toystory = media.Movie("Toy Story", "A story of a boy and his toys that come to life", "link to the movie poster", "https://www.youtube.com/watch?v=KYz2wyBy3kc", "link to the rotten tomatoes review")
avatar = media.Movie("Avatar", "A marine on an alien planet being destroyed by humans", "link to the movie poster", "https://www.youtube.com/watch?v=cRdxXPV9GNQ", "link to the rotten tomatoes review")