On Apr 29, Håvard Wahl Kongsgård <haavard.kongsga...@gmail.com> wrote:

> How do I get the year from search_movie() list (without calling
> ia.update)?
> I know that for movieID it is
> for i in ia.search_movie("matrix"):
>     print i.movieID

When you need to retrieve an information, a Movie (or Person, Company
and Character) instance behaves as a Python dictionary.

That is:
  movie['title']
  movie['year']

Beware that some information may be missing (usually not 'title' - and
'year' is present _most_ of the times), and so a better idea would be
to use  movie.get('year'), which returns None if 'year' is not a known
keyword.

In your case you don't need to call the 'update' method, since the
year is one of the few information gathered calling 'search_movie'.
Notice that the 'movieID' is not a key but an attribute of the Movie
instance, because it's not an information about the movie, but
something we need to identify it (other "contextual" information are
attributes, too).

For other information, feel free to ask or check the documentation:
   http://imdbpy.sourceforge.net/?page=docs


Bye,
-- 
Davide Alberani <davide.alber...@gmail.com> [GPG KeyID: 0x465BFD47]
http://www.mimante.net/

------------------------------------------------------------------------------
_______________________________________________
Imdbpy-help mailing list
Imdbpy-help@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/imdbpy-help

Reply via email to