Exemplo n.º 1
0
    sqli = "insert into ipdetails(creat_time,ip_str,ip_position,ip_type,del_type)values(%s,%s,%s,%s,%s)"
    cur.executemany(sqli, list)
    conn.commit()
    conn.close()


# 天网表信息插入
# tw_dict = readexcel_todict("安福天网汇总.xls".decode('utf-8'),1,1,0)
# temp_list = []
# for key in tw_dict:
#     print key
#     print tw_dict[key]
#     temp_list.append([tw_dict[key][1],str(tw_dict[key][0]),tw_dict[key][3],tw_dict[key][2],tw_dict[key][4],tw_dict[key][5],tw_dict[key][6],tw_dict[key][11],tw_dict[key][12],"admin","JADXtw2018"])

# ip 表信息插入
tw_dict = readexcel_todict("安福天网汇总.xls".decode('utf-8'), 1, 1, 0)
temp_list = []
num = 0
for key in tw_dict:
    time = datetime.now()
    if tw_dict[key][5] != "":
        temp_list.append(
            [time, tw_dict[key][5], tw_dict[key][3], tw_dict[key][4], 0])
    if tw_dict[key][6] != "":
        temp_list.append(
            [time, tw_dict[key][6], tw_dict[key][3], tw_dict[key][4], 0])
    num += 1
    print num
updata_ip_todb(temp_list)

#updata_watch_todb(temp_list)
Exemplo n.º 2
0
#coding=utf-8
import sys
from leotool.readexcel import readexcel_todict
reload(sys)
sys.setdefaultencoding('utf-8')

data_dict = readexcel_todict("data/data.xlsx", 0, 1, 0)

for key in data_dict:
    print key
    print data_dict[key]
Exemplo n.º 3
0
#coding=utf-8
import sys
reload(sys)
import threading
from leotool.readexcel import readexcel_todict
sys.setdefaultencoding('utf-8')
from test import updata_watch_todb, select_wterror, delete_wterror_todb
import subprocess

dic2 = readexcel_todict("安福天网汇总.xls".encode('GBK'), 1, 1, 1)


def check_is_nums(str_check):
    isnum = True
    for key in str_check.decode('utf-8'):
        if u'\u0030' <= key <= u'\u0039':
            pass
        else:
            isnum = False
            return isnum

    if str_check == "":
        isnum = False
    return isnum


def __load_one_chapter(list, resoult_list):
    # list[5] list[6]  服务器IP  球机IP
    if (list[14] == "不考核"):
        return
    if (list[5] == "" or list[6] == ""):