[imdbpy-Help] How to get a list of all movies and its actors

552 views
Skip to first unread message

Li Xu

unread,
Feb 27, 2014, 4:53:31 PM2/27/14
to imdbpy...@googlegroups.com
Hi!

I am currently doing a project to analysis movie data and find out what makes a good movie revenue. I am quite new in this field, and I met one question, I use "get_movie( )" in IMDBpy tot the movie title. But I find out the argument in get_movie() seems need to numbers, it can't be a variable stored integers (I want to make a for loop and make the variable changes all the time, to get all movies from IMDB).

Can someone help me out? Tks@ 

Davide Alberani

unread,
Feb 28, 2014, 5:10:59 PM2/28/14
to imdbpy...@googlegroups.com, Li Xu
Hi,
for some basics about python programming I suggest
http://docs.python.org/2/tutorial/
and http://www.python.org/about/gettingstarted/

Basically, what you want can be done with a list. E.g.:
list_of_movie_ids = ['0133093', '0234215', '0242653']
for movie_id in list_of_movie_ids:
...use movie_id in the call to get_movie()...

To generate a sequence you can use the range or xrange
builtin python functions.


Hope this helps.

--
Davide Alberani <davide....@gmail.com> [PGP KeyID: 0x465BFD47]
http://www.mimante.net/
Reply all
Reply to author
Forward
0 new messages