from Tkinter import *
import sqlite3
import sys
def pconn():
	conn=sqlite3.connect("people.db")
	cu=conn.cursor()
	return conn,cu
def  pinsert(pid,pna,pinf):
	conn,cu=pconn()
	sinsert="insert into people values('%s','%s','%s');"%(pid,pna,pinf)
	cu.execute(sinsert)
	conn.commit()
def now_in():
	one=e_id.get()
	two=e_name.get()
	three=e_name.get()
	pinsert(one,two,three)
root = Tk()
root.title("insert")
l_id= Label(root, text="id")
l_id.pack()
e_id= Entry(root)
e_id.pack()
l_name= Label(root, text="name")
l_name.pack()
e_name = Entry(root)
e_name.pack()
l_info= Label(root, text="info")
l_info.pack()
e_info= Entry(root)
e_info.pack()
b = Button(root, text="submit",command=now_in)
b.pack()
root.mainloop()