-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmovie_randomiser.py
More file actions
218 lines (196 loc) · 11.4 KB
/
Copy pathmovie_randomiser.py
File metadata and controls
218 lines (196 loc) · 11.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
# Program to randomise movie choice originating from randomised genre
# Author: Stephen C
# Date: 29/01/26
import random
## TESTING PUSH TO DEVELOPING
def print_dictionary():
genres = {1: 'Action/Adventure & Epic', 2: 'Comedy', 3: 'Drama',
4: 'Horror', 5: 'Musical', 6: 'Romance',
7: 'Science Fiction & Fantasy', 8: 'Mystery & Thriller',
9: 'War', 10: 'Western'}
# user_input = input("Would you like to see a list of genres?: ")
# if user_input == 'y' or user_input == 'Y':
# print("Genres:")
# for item in genres.values():
# print("{}".format(item))
movies = {1: 'Napoléon', 2: 'Cleopatra', 3: 'The Adventures Of Robin Hood',
4: 'Gone With The Wind', 5: 'The Sea Hawk', 6: 'The Treasure of the Sierra Madre',
7: 'The Wages of Fear (Le Salaire de la peur)', 8: 'The Seven Samurai (Shichinin no samurai)',
9: 'The Ten Commandments', 10: 'War and Peace', 11: 'The Vikings', 12: 'North by Northwest',
13: 'Ben-Hur', 14: 'Spartacus', 15: 'Lawrence of Arabia', 16: 'Zulu',
17: 'Dr Zhivago', 18: 'The Charge of the Light Brigade', 19: 'The Lion in Winter',
20: 'Waterloo', 21: 'Aguirre: The Wrath of God (Aguirre, der Zorn Gottes',
22: 'The Poseidon Adventure', 23: 'Enter the Dragon', 24: 'Papillon',
25: 'The Towering Inferno', 26: 'Raiders of the Lost Ark', 27: 'Fitzcarraldo',
28: 'Gandhi', 29: 'The Right Stuff', 30: 'A Passage To India', 31: 'Ran',
32: 'The Mission', 33: 'Top Gun', 34: 'The Last Emperor', 35: 'Die Hard',
36: 'Speed', 37: 'True Lies', 38: 'Braveheart', 39: 'The Mummy',
40: 'Crouching Tiger, Hidden Dragon (Wo Hu Cang Long)', 41: 'Gladiator',
42: 'The Lord of the Rings: The Fellowship of the Ring',
43: 'Master and Commander: The Far Side of the World',
44: 'Pirates of the Caribbean: The Curse of the Black Pearl',
45: 'Kill Bill: Vol. 1 & Vol. 2', 46: '300', 47: 'Iron Man',
48: 'Watchmen', 49: 'Skyfall', 50: 'The Avengers'}
movies_2 = {1: 'Safety Last', 2: 'The General', 3: 'Duck Soup', 4: 'It\'s A Gift',
5: 'Modern Times', 6: 'Nothing Sacred', 7: 'Way Out West',
8: 'Bringing Up Baby', 9: 'His Girl Friday', 10: 'Sullivan\'s Travel',
11: 'To Be or Not to Be', 12: 'Kind Hearts and Coronets', 13: 'Born Yesterday',
14: 'Les Vaçances de M. Hulot (Mr. Hulot’s Holiday/Monsieur Hulot’s Holiday US/GB Title)',
15: 'Some Like It Hot', 16: 'Move Over, Darling', 17: 'The Pink Panther',
18: 'The Producers', 19: 'The Odd Couple', 20: 'Harold and Maude',
21: 'What\'s Up, Doc?',
22: 'Everything You Always Wanted to Know About Sex* *But were afraid to ask',
23: 'Blazing Saddles', 24: 'Monty Python and the Holy Grail', 25: 'Animal House',
26: 'Airplane!', 27: 'Tootsie', 28: 'Trading Places', 29: 'All of Me',
30: 'This is Spinal Tap', 31: 'The Breakfast Club',
32: 'Ferris Bueller\'s Day Off', 33: 'A Fish Called Wanda',
34: 'The Naked Gun: From the Files of Police Squad', 35: 'Big',
36: 'Home Alone', 37: 'Groundhog Day', 38: 'Grosse Point Blank',
39: 'Austin Powers: International Man of Mystery', 40: 'The Big Lebowski',
41: 'There\'s Something About Mary',
42: 'Amélie (Amélie/Amélie of Montmartre US/GB Title)',
43: 'Lost in Translation', 44: 'Shaun of the Dead', 45: 'Anchorman',
46: 'A Cock and Bull Story aka Tristram Shandy: A Cock and Bull Story',
47: 'Little Miss Sunshine',
48: 'Borat: Cultural Learnings of America for Make Benefit Glorious Nation of Kazakhstan',
49: 'Juno', 50: 'Knocked Up'}
movies_3 = {1: 'Mr Smith Goes To Washington', 2: 'The Grapes of Wrath',
3: 'Citizen Kane', 4: 'The Lost Weekend',
5: 'The Best Years of Our Lives', 6: 'Great Expectations',
7: 'It\'s a Wonderful Life', 8: 'The Bicycle Thief (Ladri di Biciclette)',
9: 'All About Eve', 10: 'Sunset Boulevard', 11: 'Ace in the Hole',
12: 'On the Waterfront', 13: 'Rebel Without a Cause', 14: '12 Angry Men',
15: 'The Seventh Seal (Det sjunde inseglet)', 16: 'Sweet Smell of Success',
17: 'Vertigo',
18: 'À bout de souffle (Breathless/By a Tether (informal) USA/UK Title)',
19: 'To Kill a Mockingbird', 20: '8 1/2', 21: 'Belle de jour',
22: 'The Graduate'}
movies_4 = {1: 'Nosferatu', 2: 'The Phantom of the Opera', 3: 'Freaks',
4: 'King Kong', 5: 'Bride of Frankenstein', 6: 'Dead of Night',
7: 'Les Diaboliques', 8: 'Dracula', 9: 'Psycho', 10: 'Peeping Tom'}
movies_5 = {1: '42nd Street', 2: 'Gold Diggers of 1933', 3: 'The Gay Divoercee',
4: 'Top Hat', 5: 'Show Boat', 6: 'Alexander\'s Ragtime Band',
7: 'The Wizard of Oz', 8: 'Yankee Doodle Dandy',
9: 'The Gang\'s All Here', 10: 'Meet Me in St. Louis'}
movies_6 = {1: 'Sunrise', 2: 'It Happened One Night', 3: 'Camille',
4: 'Wuthering Heights', 5: 'The Shop Around The Corner',
6: 'Waterloo Bridge', 7: 'The Philadelphia Story',
8: 'The Lady Eve', 9: 'Casablanca', 10: 'Now, Voyager'}
movies_7 = {1: 'Metropolis', 2:'Lost Horizon',
3: 'The Day The Earth Stood Still', 4: 'War of the Worlds',
5: 'Forbidden Planet', 6: 'Invasion of the Body Snatchers',
7: 'Jason and the Argonauts',
8: 'Dr. Strangelove or: How I Learned to Stop Worrying and Love the Bomb',
9: 'Planet of the Apes', 10: '2001: A Space Odyssey'}
movies_8 = {1: 'Little Caesar', 2: 'The Public Enemy', 3: 'Rebecca',
4: 'The Maltese Falcon', 5: 'Double Indemnity', 6: 'The Big Sleep',
7: 'Kiss of Death', 8: 'The Third Man', 9: 'Strangers on a Train',
10: 'The Big Heat'}
movies_9 = {1: 'Wings', 2: 'All Quiet on the Western Front',
3: 'La Grande Illusion (The Grand Illusion)', 4: 'In Which We Serve',
5: 'Five Graves To Cairo', 6: 'The Life and Death of Colonel Blimp',
7: 'Rome, Open City (Roma, citta aperta)', 8: 'They Were Expendable',
9: 'Battle Ground', 10: 'Sands of Iwo Jima'}
movies_10 = {1: 'Union Pacific', 2: 'Stagecoach',
3: 'The Ox-Bow Incident', 4: 'Duel in the Sun', 5: 'My Darling Clementine',
6: 'Fort Apache', 7: 'Red River', 8: 'She Wore a Yellow Ribbon',
9: 'The Gunfighter', 10: 'Winchester \'73'
}
gen_mov = {'Action/Adventure & Epic': movies, 'Comedy': movies_2, 'Drama': movies_3,
'Horror': movies_4, 'Musical': movies_5, 'Romance': movies_6,
'Science Fiction & Fantasy': movies_7, 'Mystery & Thriller': movies_8,
'War': movies_9, 'Western': movies_10}
choice = input('Would you like to see a list of genres or movies?: ')
if choice == 'Yes' or choice == 'Y':
user_input = input("Would you like to see a list of genres?: ")
if user_input == 'y' or user_input == 'Y':
print("Genres:")
for item in genres.values():
print("{}".format(item))
# Come back to below. If 'n' to genre, give user a choice for movies
# genre_movie = input('\nWould you like to see a list of movies too?: ')
# if genre_movie == 'y' or genre_movie == 'Y':
elif user_input == 'n' or user_input == 'N':
movie_input = input("\nWhat about a list of movies?: ")
if movie_input == 'y' or movie_input == 'Y':
user_choice = input('What genre of movie would you like to see?: ')
if user_choice in gen_mov.keys():
for item in gen_mov[user_choice].values():
print("{}".format(item))
elif user_input == 'No' or user_input == 'N':
print('Okay! We\'ll choose a movie for you to watch instead.')
elif choice == 'No' or choice == 'N':
print('Okay! We\'ll choose a movie for you to watch instead.')
return genres, movies, movies_2, movies_3, movies_4, movies_5, movies_6, movies_7, movies_8, movies_9, movies_10
def genre(genres):
genre_choice = random.choice(list(genres.values()))
print('\nI\'ve randomised a genre from the list, it\'s shown below.')
print('Genre: ', genre_choice)
return genre_choice
def movie_choice(genre_choice):
if genre_choice == 'Action/Adventure & Epic':
movie = random.choice(list(movies.values()))
print(f'\nThe {genre_choice.lower()} movie you should watch is shown below.')
print('Movie: ', movie)
elif genre_choice == 'Comedy':
movie = random.choice(list(movies_2.values()))
print(f'\nThe {genre_choice.lower()} movie you should watch is shown below.')
print('Movie: ', movie)
elif genre_choice == 'Drama':
movie = random.choice(list(movies_3.values()))
print(f'\nThe {genre_choice.lower()} movie you should watch is shown below.')
print('Movie: ', movie)
elif genre_choice == 'Horror':
movie = random.choice(list(movies_4.values()))
print(f'\nThe {genre_choice.lower()} movie you should watch is shown below.')
print('Movie: ', movie)
elif genre_choice == 'Musical':
movie = random.choice(list(movies_5.values()))
print(f'\nThe {genre_choice.lower()} movie you should watch is shown below.')
print('Movie: ', movie)
elif genre_choice == 'Romance':
movie = random.choice(list(movies_6.values()))
print(f'\nThe {genre_choice.lower()} movie you should watch is shown below.')
print('Movie: ', movie)
elif genre_choice == 'Science Fiction & Fantasy':
movie = random.choice(list(movies_7.values()))
print(f'\nThe {genre_choice.lower()} movie you should watch is shown below.')
print('Movie: ', movie)
elif genre_choice == 'Mystery & Thriller':
movie = random.choice(list(movies_8.values()))
print(f'\nThe {genre_choice.lower()} movie you should watch is shown below.')
print('Movie: ', movie)
elif genre_choice == 'War':
movie = random.choice(list(movies_9.values()))
print(f'\nThe {genre_choice.lower()} movie you should watch is shown below.')
print('Movie: ', movie)
elif genre_choice == 'Western':
movie = random.choice(list(movies_10.values()))
print(f'\nThe {genre_choice.lower()} movie you should watch is shown below.')
print('Movie: ', movie)
return movie
def seen_movies(movie):
#FOR PERSONAL USE, I SHOULD CREATE A LIST OF MOVIES THAT I HAVE SEEN
# BY CREATING A WAY TO MANUALLY ADD THE MOVIES THAT I HAVE SEEN
# NEED TO SAVE TO FILE SO DATA PERSISTS ACROSS PROGRAM EXECUTIONS
seen_movies = []
choice = input('\nHave you seen this movie? (\'Yes or No\'): ')
if choice == 'Yes' or choice == 'Y':
print('That\'s a good one! I\'ll add it to your list.')
if movie not in seen_movies:
seen_movies.append(movie)
else:
print('It looks like you\'ve already seen this one.\n'
'It\'s already in your list.')
else:
print('Enjoy the film!')
for item in seen_movies:
print(f'{item} has been added to the list of seen movies.')
def main(genre_choice):
movie = movie_choice(genre_choice)
return movie
if __name__ == '__main__':
genre_choice, movies, movies_2, movies_3, movies_4, movies_5, movies_6, movies_7, movies_8, movies_9, movies_10 = print_dictionary()
genre_choice = genre(genre_choice)
movie = main(genre_choice)
seen_movies(movie)