本文整理匯總了Python中channel.Channel.addMovie方法的典型用法代碼示例。如果您正苦於以下問題:Python Channel.addMovie方法的具體用法?Python Channel.addMovie怎麽用?Python Channel.addMovie使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類channel.Channel
的用法示例。
在下文中一共展示了Channel.addMovie方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: Genre
# 需要導入模塊: from channel import Channel [as 別名]
# 或者: from channel.Channel import addMovie [as 別名]
found = True
if not found:
newGenre = Genre(genre)
newGenre.addMovie(mv)
genres.append(newGenre)
# Sort them by number of movies
genres = sorted(genres, key=lambda x: x.movieCount, reverse=True)
# We build some channels from the 10 heaviest genres
channels = []
i=0
for genre in genres:
newChannel = Channel(genre.name)
for mv in genre.movies:
newChannel.addMovie(mv)
newChannel.buildSchedule(86400000)
channels.append(newChannel)
del genre
i+=1
if i > 10:
break
#Serialize the channels and write them to a json
data = []
for channel in channels:
moviesData = []
for mv in channel.schedule:
moviesData.append(dict({
"title":mv.title,