File tree 1 file changed +0
-19
lines changed 1 file changed +0
-19
lines changed Original file line number Diff line number Diff line change @@ -63,40 +63,21 @@ def process():
63
63
QueryData (conn )
64
64
dbconn .close ()
65
65
66
- #def execute(sql):
67
- # '''执行sql'''
68
- # conn=dbconn.cursor()
69
- # conn.execute(sql)
70
-
71
- #def executemany(sql, tmp):
72
- # '''插入多条数据'''
73
- # conn=dbconn.cursor()
74
- # conn.executemany(sql,tmp)
75
-
76
66
def query (sql ,conn ):
77
- '''查询sql'''
78
- #conn=dbconn.cursor()
79
67
conn .execute (sql )
80
68
rows = conn .fetchall ()
81
69
return rows
82
70
83
71
def DropTable (conn ):
84
- #conn=dbconn.cursor()
85
72
conn .execute ("DROP TABLE IF EXISTS `user_key`" )
86
73
87
74
def CreateTable (conn ):
88
- #conn=dbconn.cursor()
89
75
sql_create = ''' CREATE TABLE `user_key` (`key` varchar(50) NOT NULL)'''
90
76
conn .execute (sql_create )
91
77
92
78
def InsertDatas (conn ):
93
- #conn=dbconn.cursor()
94
- #insert_sql = "insert into user_key values(%s)"
95
79
insert_sql = "INSERT INTO user_key VALUES (%(value)s)"
96
80
key_list = key_num (KEY_ALL )
97
- #print len(key_list)
98
- #conn.executemany(insert_sql,str(key_listi))
99
- #conn.executemany("INSERT INTO user_key VALUES (%(value)s)",[dict(value=v) for v in key_list])
100
81
conn .executemany (insert_sql ,[dict (value = v ) for v in key_list ])
101
82
102
83
def DeleteData ():
You can’t perform that action at this time.
0 commit comments