Exemplo n.º 1
0
def reg():
    print("register")
    firstname = input("Please enter a firstname: ")
    lastname = input("Please enter a lastname: ")
    newemail = input("your email: ")
    while not re.match(r"^[a-zA-Z][a-zA-Z0-9\.]+\@[a-zA-Z]+\.[a-zA-Z]{3}",
                       newemail):
        newemail = input("your email: ")
    password = input("Now password: "******"Now Retype password: "******"Now Retype password: "******"login.txt", "a")
    file.write(firstname)
    file.write(",")
    file.write(lastname)
    file.write(",")
    file.write(newemail)
    file.write(",")
    file.write(password)
    file.write("\n")
    file.close()
    print("Your login details have been saved. ")
    print("You need to login now")
    login.log()
Exemplo n.º 2
0
def courses(started):
    # login -> navigate to the 'grades' tab
    log(started)
    grades(started)

    source = driver.page_source
    soup = BeautifulSoup(source, 'html.parser')

    # get all courses
    courses = [
        a.string for a in soup.find_all('a', href=True) if a.string is not None
    ]

    return courses
 def Logout():
     root2.withdraw()
     print "successful logout"
     import login
     a = login.log()
     c = 1
     a.begin(c)
Exemplo n.º 4
0
def main():
    print("WELCOME TO CAB BOOKING SYSTEM".center(100, '*'))
    print("1.Register as a new user")
    print("2.Login to an existing account")
    print("3.Admin Login")
    print("4.Exit the application")
    ch = input("Enter your choice: ")
    if ch == '1':
        res = reg()
        user_activities(res)

    elif ch == '2':
        res = log()
        if res == "Invalid":
            print("Invalid credentials\n")
            while True:
                res = log()
                if res != "Invalid":
                    clear()
                    print("Welcome " + res)
                    user_activities(res)

        else:
            clear()
            print("Welcome " + res)
            user_activities(res)

    elif ch == '3':
        name = input("Enter username: "******"Enter email: ")
        if not validate_admin(email, name):
            while True:
                name = input("Enter username: "******"Enter email: ")
                if validate_admin(email, name):
                    admin_activities()

        else:
            admin_activities()

    elif ch == '4':
        quit()

    else:
        print("Enter a valid Choice")
        main()
Exemplo n.º 5
0
def login():
    form = log(request.form)
    if request.method == "POST" and form.validate():
        cur = mysql.connection.cursor()
        email = form.email.data
        password = form.password.data
        cur.execute(
            "SELECT email,password FROM login_details WHERE email=%s AND password=%s",
            (email, password))
        validate = cur.fetchone()
        if len(validate) != 0:
            cur.execute(
                "SELECT name FROM login_details WHERE email=%s AND password=%s",
                (email, password))
            data = cur.fetchone()
            session['is_login'] = True
            session['priority'] = False
            session['name'] = data['name']
            return redirect(url_for('dashboard'))
    return render_template('login.html', form=form)
import login

a = login.log()
c = 0
a.begin(c)
from video import vid
vid()
from login import log
log() 
Exemplo n.º 8
0
from socket import AF_INET, socket, SOCK_STREAM
from threading import Thread
import tkinter
import login
import compose
import rcv 
import rd_wt

data = login.log()

HOST = '127.0.0.1'
PORT = 12000
BUFSIZ = 1024
ADDR = (HOST, PORT)

client_socket = socket(AF_INET, SOCK_STREAM)
client_socket.connect(ADDR)

def begin():
	client_socket.send(bytes(data[0].get(),"utf8"))

def receive(client_socket):
    """Handles receiving of messages."""
    while True:
        mess = client_socket.recv(BUFSIZ).decode("utf8")
                
        if(mess != ""):
            mess = mess.split("~")
            From = mess[3]
            Title = mess[1]
            Body = mess[2]
Exemplo n.º 9
0
import register
import login

choice = input("""
choose 1 or 2
1) register now
2) login now
""")

if choice == "1":
    register.reg()
elif choice == "2":
    login.log()
Exemplo n.º 10
0
	5.Hot Chocolate:\tRs.40\n
	6.Fruit Punch:\t\tRs.40\n
	7.Orange Juice:\t\tRs.30\n
	8.Tea:\t\t\tRs.20\n
	9.Cold Coffee:\t\tRs.50\n
\n-----------------------------------------***------------------------------------\n'''
	order(drinks,2)
	
start.welcome()	
flag1=0
while flag1==0:
	yes1=raw_input("Do you have a reservation?\nY/N\n")
	yes=yes1.lower()
	if yes=='n':
		file.res()
		flag1=login.log()

	else : 
		flag1=login.log()
	
while True:		
	if flag1==1:
		print '\nEnter the choice of food\n','\t1.Food\t2.Drinks\t3.Exit\n'
		choice=raw_input()
		if int(choice)==1:	
			food()
		elif int(choice)==2:
			drink()
		else: break
	else : 
		print "login failed\n"