Member-only story

Movie Information using Python

Python Coding
2 min readAug 18, 2024

--

import imdb

ia = imdb.Cinemagoer()
Movie = input("Enter a movie name: ")
items = ia.search_movie(Movie)
print("\nSearch results:")
for index, movie in enumerate(items):
print(f"{index + 1}. {movie['title']} ({movie['year']})")

movie_index = int(input("\nEnter the number of the movie you want to get info for: ")) - 1
movie_id = items[movie_index].movieID
movie_info = ia.get_movie(movie_id)

print("\nMovie Information:")
print(f"Title: {movie_info.get('title')}")
print(f"Year: {movie_info.get('year')}")
print(f"Rating: {movie_info.get('rating')}")
print(f"Genres: {', '.join(movie_info.get('genres', []))}")
print(f"Director(s): {', '.join(str(d) for d in movie_info.get('directors', []))}")
print(f"Cast: {', '.join(str(c) for c in movie_info.get('cast', [])[:5])}...")
print(f"Plot: {movie_info.get('plot outline')}")
print(f"Runtime: {movie_info.get('runtimes', ['N/A'])[0]} minutes")
print(f"Country: {', '.join(movie_info.get('countries', []))}")
print(f"Language: {', '.join(movie_info.get('languages', []))}")

#Source Code --> clcoding.com
Search results:
1. Lift (2024)
2. Elevator to the Gallows (1958)
3. Lift (2021)
4. The Lift (1983)
5. Lift (2001)
6. The Big Lift (1950)
7. Lift (2022)
8. Lift (2016)
9. Lift Off (1992)
10. How Heavy Are the Dumbbells You Lift? (2019)
11. Lift (1989)
12. Lift Me Up (2015)
13. The Lift Boy (2019)
14. Lift (2019)
15. Lift (2017)
16. Lift (2018)
17. The…

--

--

Python Coding
Python Coding

Written by Python Coding

Learn python tips and tricks with code I Share your knowledge with us to help society. Python Quiz: https://www.clcoding.com/p/quiz-questions.html

Responses (1)