Python Forum
Thread Rating:
  • 1 Vote(s) - 2 Average
  • 1
  • 2
  • 3
  • 4
  • 5
cinemagoer library problem
#1
I am trying to make an application that in part prints out the last 10 films released based on actor which means i want to exclude announced films if they haven/t been released yet

def get_data_actor_name(id):
    global movie_name,cg
    search = cg.get_person(id)
    filmography=cg.get_person_filmography(id)
    last_ten_films=filmography['data']['filmography']['actor']


    for movie in last_ten_films:
        if bool(movie['year']):
            movie_name.append(movie['title'], movie['year'])

    messagebox.showinfo(title=f"{search}'s latest film information", message=f"{movie_name}")
    movie_name.clear()
the code above returns a KeyError (year) as you can see below

Error:
Exception in Tkinter callback Traceback (most recent call last): File "C:\Users\giorg\AppData\Local\Programs\Python\Python39\lib\tkinter\__init__.py", line 1892, in __call__ return self.func(*args) File "C:\Users\giorg\PycharmProjects\pythonProject2\IMDB\main.py", line 65, in search_for_info check_answer(search) File "C:\Users\giorg\PycharmProjects\pythonProject2\IMDB\main.py", line 38, in check_answer get_data_actor_name(id) File "C:\Users\giorg\PycharmProjects\pythonProject2\IMDB\main.py", line 21, in get_data_actor_name if bool(movie['year']): File "C:\Users\giorg\AppData\Local\Programs\Python\Python39\lib\site-packages\imdb\utils.py", line 1503, in __getitem__ rawData = self.data[key] KeyError: 'year'
Reply


Messages In This Thread
cinemagoer library problem - by lunacy90 - Sep-04-2023, 06:19 PM
RE: cinemagoer library problem - by menator01 - Sep-04-2023, 06:28 PM
RE: cinemagoer library problem - by deanhystad - Sep-04-2023, 06:45 PM
RE: cinemagoer library problem - by lunacy90 - Sep-04-2023, 07:55 PM
RE: cinemagoer library problem - by deanhystad - Sep-04-2023, 08:15 PM
RE: cinemagoer library problem - by menator01 - Sep-05-2023, 12:59 AM
RE: cinemagoer library problem - by deanhystad - Sep-05-2023, 01:41 AM
RE: cinemagoer library problem - by menator01 - Sep-05-2023, 03:24 AM
RE: cinemagoer library problem - by lunacy90 - Sep-05-2023, 10:12 AM
RE: cinemagoer library problem - by lunacy90 - Sep-05-2023, 10:58 AM
RE: cinemagoer library problem - by menator01 - Sep-07-2023, 04:47 PM
RE: cinemagoer library problem - by lunacy90 - Sep-05-2023, 11:58 AM
RE: cinemagoer library problem - by deanhystad - Sep-05-2023, 12:24 PM
RE: cinemagoer library problem - by lunacy90 - Sep-05-2023, 01:30 PM
RE: cinemagoer library problem - by menator01 - Sep-05-2023, 09:30 PM
RE: cinemagoer library problem - by deanhystad - Sep-05-2023, 10:21 PM
RE: cinemagoer library problem - by menator01 - Sep-05-2023, 11:50 PM
RE: cinemagoer library problem - by menator01 - Sep-06-2023, 08:06 AM
RE: cinemagoer library problem - by lunacy90 - Sep-08-2023, 03:16 PM
RE: cinemagoer library problem - by deanhystad - Sep-07-2023, 06:37 PM
RE: cinemagoer library problem - by menator01 - Sep-07-2023, 06:56 PM
RE: cinemagoer library problem - by menator01 - Sep-08-2023, 04:30 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Problem with importing python-telegram library into the project gandonio 1 1,621 Nov-01-2022, 02:19 AM
Last Post: deanhystad
  Problem with using Crypto library reks2004 2 2,462 Mar-27-2020, 05:38 AM
Last Post: buran
  Problem installing library thunderspeed 2 2,358 Mar-22-2020, 11:04 PM
Last Post: thunderspeed
  Problem importing resource library ChrisM 8 4,013 Oct-23-2019, 01:40 PM
Last Post: ChrisM
  Problem Using Python Library abir99 8 5,441 Nov-21-2017, 03:12 PM
Last Post: sparkz_alot
  PyInstaller, how to create library folder instead of library.zip file ? harun2525 2 4,863 May-06-2017, 11:29 AM
Last Post: harun2525

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020