Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from Tkinter import *
- import subprocess
- import sqlite3
- class Start():
- def __init__(self):
- self.root = Tk()
- self.root.geometry("300x200")
- self.leb = Label(self.root, text="username:")
- self.leb.place(x=20,y=20)
- self.net = Label(self.root, text="password:")
- self.net.place(x=20,y=40)
- self.ley = Entry(self.root,)
- self.ley.place(x=80,y=25)
- self.ley2 = Entry(self.root, show="*")
- self.ley2.place(x=80, y=45)
- self.butt = Button(self.root, text="login")
- self.butt.place(x=165,y=95)
- self.butt2 = Button(self.root, text="registration", command=self.registration)
- self.butt2.place(x=15, y=95)
- mainloop()
- def registration(self):
- self.root2= Tk()
- self.root2.geometry("400x200")
- self.eny3 = Label(self.root2, text="first name")
- self.eny3.place(x=20,y=20)
- self.eny3 = Label(self.root2, text="lest name")
- self.eny3.place(x=20, y=40)
- self.eny3 = Label(self.root2, text="email")
- self.eny3.place(x=20, y=60)
- self.eny3 = Label(self.root2, text="password")
- self.eny3.place(x=20, y=80)
- self.eny3 = Label(self.root2, text="second password")
- self.eny3.place(x=20, y=100)
- self.br1 = Entry(self.root2)
- self.br1.place(x=80,y=20)
- self.br2 = Entry(self.root2)
- self.br2.place(x=80,y=40)
- self.br3 = Entry(self.root2)
- self.br3.place(x=80,y=60)
- self.br4 = Entry(self.root2, show="*")
- self.br4.place(x=80,y=80)
- self.br5 = Entry(self.root2, show="*")
- self.br5.place(x=120, y=100)
- self.butt3 = Button(self.root2, text="register", command=self.checksocket)
- self.butt3.place(x=195,y=150)
- def checksocket(self):
- firstname= self.br1.get()
- lesttname = self.br2.get()
- email = self.br3.get()
- password = self.br4.get()
- password2 = self.br5.get()
- conn = sqlite3.connect("myweb.db")
- c = conn.cursor()
- names1 = [self.br1.get(),self.br2.get(),self.br3.get(),self.br4.get(),self.br5.get()]
- c.execute('''create table if not exists michael2(id integer primary key autoincrement, firstname varchar(100),lestname varchar(200), email varchar(200),password varchar(200),scuondpasssowrd varchar(200))''')
- for inv in names1:
- c.execute("insert into michael2(firstname,lestname,email) values (?,?,?)"),(firstname,lesttname,email)
- sql = "select * from michael"
- c.execute(sql)
- ssss =c.fetchall()
- for o in ssss:
- print o
- #for i1 in names1:
- # c.execute("insert into username(id,username,password) values(NULL,?,?,?,?,?)",[i1])
- #for n in c.execute("SELECT * FROM tasks"):
- # print n
- conn.commit()
- f = Start()
- def main():
- f
- main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement