📜  Python IMDbPY – 搜索一个人

📅  最后修改于: 2022-05-13 01:55:22.639000             🧑  作者: Mango

Python IMDbPY – 搜索一个人

IMDbPY 是一个Python包,用于检索和管理 IMDb 的数据。在本文中,我们将看到如何在 IMDb 数据库中搜索具有给定姓名的人,我们可以借助 search_person 方法来做到这一点。

下面是实现

Python3
# importing the module
import imdb
 
# creating instance of IMDb
ia = imdb.IMDb()
 
# name of the person
name = "Akshay Kumar"
 
# searching the name of the person
search = ia.search_person(name)
 
# printing the result
for i in search :
    print(i)


Python3
# importing the module
import imdb
 
# creating instance of IMDb
ia = imdb.IMDb()
 
# name of the person
name = "Neil nitin mukesh"
 
# searching the name of the person
search = ia.search_person(name)
 
# printing the result
print(search)


输出 :

Akshay Kumar
Akshay Kumar
Akshay Kumar
Akshay Kumar Parija
Akshay Kumar Saxena
Akshay Kumar Pradhan
Akshay Kumar
Akshay Kumar Patil
Lakshay Kumar
Akshay Kumar
Akshay Kumar
Akshay Kumar
Akshay Kumar
Akshay Kumar
Lakshay Kumar
Akshay Kumar Ahitan
Akshay Kumar Rahi
Akshay Kumar Boral
Akshaykumar Patil
Akshay Kumar Sharma

另一个例子 os 搜索一个人

Python3

# importing the module
import imdb
 
# creating instance of IMDb
ia = imdb.IMDb()
 
# name of the person
name = "Neil nitin mukesh"
 
# searching the name of the person
search = ia.search_person(name)
 
# printing the result
print(search)

输出 :