예제 #1
0
import movie_class
import movie_website

syriana = movie_class.Movie(
    "Syriana", "Yet another CIA mess in a Middle East monarchy",
    "http://www.impawards.com/2005/posters/syriana_ver2.jpg",
    "https://www.youtube.com/watch?v=JvTni7Nggi0")

arbitrage = movie_class.Movie(
    "Arbitrage", "Power is the best alibi",
    "http://www.impawards.com/2012/posters/arbitrage_ver4.jpg",
    "https://www.youtube.com/watch?	v=UmJSV9ePx7c")

movie_list = [syriana, arbitrage]

movie_website.open_movies_page(movie_list)
from __future__ import unicode_literals
# I have read on a forum that my encoding errors could be solved by importing the unicode_literals from Python 3
# so I did and it solved almost all of the codec errors

# coding: utf8

import media
import movie_website

snatch = media.Movie("http://www.imdb.com/title/tt0208092/",
                     "https://www.youtube.com/watch?v=ni4tEtuTccc")
inside_jobs = media.Movie("http://www.imdb.com/title/tt1645089/",
                          "https://www.youtube.com/watch?v=FzrBurlJUNk")
district_9 = media.Movie("http://www.imdb.com/title/tt1136608/",
                         "https://www.youtube.com/watch?v=82s9atP0teY")
coach_carter = media.Movie("http://www.imdb.com/title/tt0393162/",
                           "https://www.youtube.com/watch?v=znyAnWUYf2g")
inception = media.Movie("http://www.imdb.com/title/tt1375666/",
                        "https://www.youtube.com/watch?v=YoHD9XEInc0")
interstellar = media.Movie("http://www.imdb.com/title/tt0816692/",
                           "https://www.youtube.com/watch?v=3WzHXI5HizQ")

movies = [
    snatch, inside_jobs, district_9, coach_carter, inception, interstellar
]

movie_website.open_movies_page(movies)

#for e in movies:
#	print e.imdb_rating
예제 #3
0
import media
import movie_website

toy_story= media.Movie('Toy Story', storyline='To infinity and beyond',
					   image='https://upload.wikimedia.org/wikipedia/en/1/13/Toy_Story.jpg',
					   trailer='https://www.youtube.com/watch?v=KYz2wyBy3kc')

avatar   = media.Movie('Avatar', storyline='Iconic Sci-fi movie',
					   image='https://upload.wikimedia.org/wikipedia/en/b/b0/Avatar-Teaser-Poster.jpg',
					   trailer='https://www.youtube.com/watch?v=cRdxXPV9GNQ')

the_matrix = media.Movie('The Matrix', storyline='We don\'t live in a similation, or do we?',
					   image='https://upload.wikimedia.org/wikipedia/en/c/c1/The_Matrix_Poster.jpg',
					   trailer='https://www.youtube.com/watch?v=vKQi3bBA1y8')

casino_royale= media.Movie('Casino royale', storyline='James Bond Movie',
					   image='https://upload.wikimedia.org/wikipedia/en/1/15/Casino_Royale_2_-_UK_cinema_poster.jpg',
					   trailer='https://www.youtube.com/watch?v=fl5WHj0bZ2Q')

star_trek = media.Movie('Star Trek', storyline='Star Trek Discovery',
					   image='http://www.anenglishmaninsandiego.com/wp-content/uploads/2017/09/poster-Star-Trek-Discovery-netflix-poster.jpg',
					   trailer='https://www.youtube.com/watch?v=oWnYtyNKPsA')

last_air_bender = media.Movie('The last airbender', storyline='Only the avatar',
					   image='https://www.justwatch.com/images/poster/462193/s592/avatar-the-last-airbender',
					   trailer='https://www.youtube.com/watch?v=Rz7EsOua-D4')

movie_website.open_movies_page([casino_royale, the_matrix, avatar,toy_story, star_trek, last_air_bender])