Getting different movie info from script than from python shell -


i have following script output cast of movie text document:

import imdb  ia = imdb.imdb() movie = ia.get_movie(0111161) cast = movie['cast'] text_file = open("cast.txt", "w") text_file.write("{0}".format(movie)) text_file.write("{0}".format(cast)) text_file.close() 

as can see scrape imdb website not database. when execute script in python shell (2.7.13) cast of 'the shawshank redemption', when execute command line (python myscript.py), cast of movie '29 acacia avenue', id=0037489. how can happen?

you should use

movie = ia.get_movie("0111161")

instead of

movie = ia.get_movie(0111161)


Comments

Popular posts from this blog

python - Operations inside variables -

Generic Map Parameter java -

arrays - What causes a java.lang.ArrayIndexOutOfBoundsException and how do I prevent it? -