本文整理汇总了Python中writer.Writer.printFilmsDataFromActor方法的典型用法代码示例。如果您正苦于以下问题:Python Writer.printFilmsDataFromActor方法的具体用法?Python Writer.printFilmsDataFromActor怎么用?Python Writer.printFilmsDataFromActor使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类writer.Writer
的用法示例。
在下文中一共展示了Writer.printFilmsDataFromActor方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: while
# 需要导入模块: from writer import Writer [as 别名]
# 或者: from writer.Writer import printFilmsDataFromActor [as 别名]
Only full names are supported as they appear in the IMDB database, but if the name is not found, a
broad spectrum search is performed. In this search, the name is splitted in all the parts it have
and print the info of all the actors that fit to any of those partial names.
'''
option = ""
while(option != "0"):
print(("Please write the name of an actor or actress to know all the films where he/she appear "
+ "(Only full names supported)"
+ " , write 0 to exit:"))
option = str(input('Enter the actor name option: '))
db = FileHandler()
writer = Writer()
db.openActDB()
if option != "0" and option != "":
films = db.searchActor(option)
if len(films) > 0:
writer.printFilmsDataFromActor(option, films)
else:
print(("%s not found") % (option))
print(("A broad spectrum search will take place, wait a moment"))
result = db.broadSpectrumSearchActor(option)
print(("All the actors whose name contains any of the words provided will be listed now"))
for key in result.keys():
writer.printFilmsDataFromActor(key, result[key])
else:
print("Exiting")
db.closeActDB()