forked from zhenglu8/Plagiarism-Detection-System
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSignUp.py
50 lines (37 loc) · 1.28 KB
/
SignUp.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
from tkinter import *
from tkinter import ttk
import pyrelog as pl
window = Tk()
window.title("Plagiarism Detection System")
canvas = Canvas(window, width=600, height=300)
canvas.grid(columnspan=2, rowspan=4)
# Define a new function to move to login page
def signup():
user = entry1.get()
password = entry2.get()
try:
pl.signup(user,password)
window.destroy()
import LogIn
except:
#switch with tkinter display of failed login (password under 6 character, existing email)
print("invalid login information")
label1 = Label(window, text="Username", font="Raleway")
label1.grid(row=0, column=0)
label2 = Label(window, text="Password", font="Raleway")
label2.grid(row=1, column=0)
username_text = StringVar()
entry1 = Entry(window, textvariable=username_text)
entry1.grid(row=0, column=1)
password_text = StringVar()
entry2 = Entry(window, textvariable=password_text)
entry2.grid(row=1, column=1)
# Sign up button
button1 = Button(window, text="Signup", height=2, width=12,
font="Raleway", bg="#20bebe", fg="white", command=signup)
button1.grid(row=2, column=0)
# Exit button
button2 = Button(window, text="Exit", height=2, width=12,
font="Raleway", bg="#20bebe", fg="white", command=lambda: window.destroy())
button2.grid(row=2, column=1)
window.mainloop()