|
from tkinter import *
mygui=Tk()
mymenu=Menu()
mymenu.add_command(label="打开")
mymenu.add_command(label="保存")
mymenu.add_command(label="删除")
mygui.config(menu=mymenu)
text=Text(width=30,height=3)
text1=Text(width=30,height=3)
text2=Text(width=30,height=60)
btn = Button()
btn['text']='登录'
btn.pack()
text.pack()
text1.pack()
text2.pack()
import pymysql
单击按钮完成下列事件怎么弄啊????
# 打开数据库连接
db = pymysql.connect("localhost","root","123123","qac" )
# 使用cursor()方法获取操作游标
cursor = db.cursor()
# SQL 插入语句
sql = """INSERT INTO user(name,
Password,tele)
VALUES (text,text1,text2)"""
cursor.execute(sql)
db.commit()
db.close()
|
|