本文整理匯總了Python中movie.Movie.dumpImg方法的典型用法代碼示例。如果您正苦於以下問題:Python Movie.dumpImg方法的具體用法?Python Movie.dumpImg怎麽用?Python Movie.dumpImg使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類movie.Movie
的用法示例。
在下文中一共展示了Movie.dumpImg方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: while
# 需要導入模塊: from movie import Movie [as 別名]
# 或者: from movie.Movie import dumpImg [as 別名]
#!/usr/bin/python
# -*- coding: utf-8 -*-
__author__ = 'dai'
import time
from movie import Movie
from red import Red
from model import MovieDB, session
while (True):
print(time.strftime("%H:%M"))
m = Movie("http://movie.douban.com/")
m.dumpImg()
r = Red(0)
for i in m.arr:
#如果存在記錄,則更新評論人數和評級
if(session.query(MovieDB).filter_by(title=i['title']).first() is not None):
d = m.updateInfo(i['info'])
try:
s = session.query(MovieDB).filter_by(title=i['title']).first()
s.average=d['average']
s.votes=d['votes']
session.add(s)
session.commit()
except Exception:
continue
else:
d = m.getInfo(i['info'],i['title'])
s = MovieDB(title = i['title'],
director = d['director'],