本文整理汇总了Python中fetcher.Fetcher.insertDataToMySQL方法的典型用法代码示例。如果您正苦于以下问题:Python Fetcher.insertDataToMySQL方法的具体用法?Python Fetcher.insertDataToMySQL怎么用?Python Fetcher.insertDataToMySQL使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类fetcher.Fetcher
的用法示例。
在下文中一共展示了Fetcher.insertDataToMySQL方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: main
# 需要导入模块: from fetcher import Fetcher [as 别名]
# 或者: from fetcher.Fetcher import insertDataToMySQL [as 别名]
def main():
obj = Fetcher()
#初始化数据,比如 分类表
# obj.initData()
# 取出117 chuancai 保存mysql
# datalist1 = obj.fromAccessToList(1)
# for data in datalist1:
# print data[0]
# obj.insertDataToMySQL(data)
# 取出118 yuecai
# datalist2 = obj.fromAccessToList(2)
# for data in datalist2:
# obj.insertDataToMySQL(data)
# 取出119 xiangcai
# datalist3 = obj.fromAccessToList(3)
# for data in datalist3:
# obj.insertDataToMySQL(data)
#
# # 取出 120 jingcai
# datalist4 = obj.fromAccessToList(4)
# for data in datalist4:
# obj.insertDataToMySQL(data)
# 取出 121 lucai
# datalist5 = obj.fromAccessToList(5)
# for data in datalist5:
# obj.insertDataToMySQL(data)
#取出 122 mincai
# datalist6 = obj.fromAccessToList(6)
# for data in datalist6:
# obj.insertDataToMySQL(data)
# #取出 123 huicai
# datalist7 = obj.fromAccessToList(7)
# for data in datalist7:
# obj.insertDataToMySQL(data)
#
# #取出 124 zhecai
# datalist8 = obj.fromAccessToList(8)
# for data in datalist8:
# obj.insertDataToMySQL(data)
#
#取出 125 shucai
datalist9 = obj.fromAccessToList(9)
for data in datalist9:
obj.insertDataToMySQL(data)
#取出 126 ecai
datalist10 = obj.fromAccessToList(10)
for data in datalist10:
obj.insertDataToMySQL(data)
#取出 127 diancai
datalist11 = obj.fromAccessToList(11)
for data in datalist11:
obj.insertDataToMySQL(data)
#取出 128 liaocai
datalist12 = obj.fromAccessToList(12)
for data in datalist12:
obj.insertDataToMySQL(data)
#取出 129 sifangcai
datalist13 = obj.fromAccessToList(13)
for data in datalist13:
obj.insertDataToMySQL(data)
print "save ok"
示例2: run
# 需要导入模块: from fetcher import Fetcher [as 别名]
# 或者: from fetcher.Fetcher import insertDataToMySQL [as 别名]
def run(self):
for data in self.data_list:
obj = Fetcher()
obj.insertDataToMySQL(data)
time.sleep(self.interval)