Hi everyone. I'm making a simple python script that would compare two movies ( inputed by the user) and compare them based on their ratings, popularity, etc.. RIght now i'm having trouble understanding the methods and how to use them in my python script. Can someone explain how to call the methods, and how to create the objects/instances. this is my code so far, which doesn't output information on the 2 moveies ( becuase there are two 'responses'. I can't just change that into response 2, and i'm confused on how to sue the search.results). Thanks!
code:
import tmdbsimple as tmdb
tmdb.API_KEY='my key'
search = tmdb.Search()
Userinput=input('Enter first movie name:')
response = search.movie(query=Userinput)
Userinput2=input('Enter Second movie name:')
response = search.movie(query=Userinput2)
for s in (search.results):
print(s['title'], s['popularity'])
(you might not be able to read the code cuz the fourm formatting messes it up. Paste into word or something to see it properly)
output:
Enter first movie name:bourne
Enter Second movie name:titanic
Titanic 2.65792
Titanic 0.138529
Titanic 0.003383
Titanic 0.002762
Titanic 2 0.350961
Titanic 2000 0.223806
Titanic : L'incroyable tragédie 0.0003
Buffet Titanic 0.1
Asia's Titanic 0.0
Titanic Arrogance 0.00321
Titanic Revealed 0.000429
Titanic Town 0.000171
The Titanic 0.0
Words of the Titanic 0.004257
Save the Titanic With Bob Ballard 0.001941
Titanic: The Shocking Truth 0.001714
Titanic: Birth of a Legend 0.000429
Titanic - One voyage 0.048239
Raise the Titanic 0.193453
S.O.S. Titanic 0.003114
Can't find a movie or TV show? Login to create it.
Want to rate or add this item to a list?
Not a member?