def __init__(self): try: self.conn = ToolsBox.get_database() # self.conn = pymysql.connect(host="office.xmcdhpg.cn", user="******", passwd="root", db="property_info", # charset="utf8", port=6153) except: print("Connect failed") self.cur = self.conn.cursor(cursor=pymysql.cursors.DictCursor) self.rows = [] self.where = 'first_acquisition_time <= DATE_SUB(CURDATE(), INTERVAL 3 month )'
def __init__(self): try: self.db = ToolsBox.get_database() # self.db = pymysql.connect(host ='office.xmcdhpg.cn', user ="******", passwd ="root", db ="property_info", charset ="utf8", port = 6153) except: print("连接失败!") if self.db: self.cursor = self.db.cursor(cursor=pymysql.cursors.DictCursor) self.comm_arr = self.get_comm_arr_fromMysql(0) self.road_arr = self.get_comm_arr_fromMysql(1)
def __init__(self): self.raw_datas = [] #数据集:原始数据 self.datasWithoutClear = [] self.dupli_count = 0 #计数:重复的数据 self.now = datetime.date.today() #字段:插入记录的日期 self.key_infos = bloomfilter.BloomFilter(0.001,1000000) #学习使用bloomfilter try: # self.conn=pymysql.connect(host = "192.168.1.207",user = "******",passwd = "root",db = "property_info",charset = "utf8") self.conn = ToolsBox.get_database() # self.conn=pymysql.connect(host = "office.xmcdhpg.cn",user = "******",passwd = "root",db = "property_info",charset = "utf8",port = 6153) except: print( "初始化时Connect failed") self.cur = self.conn.cursor(cursor=pymysql.cursors.DictCursor) # 用字典