def main(): print("Enter Your choise") print("1. SignUp") print('2. LogIn') print() choise = input() if (choise == '1'): function.signup() elif (choise == '2'): function.login()
def in_control(flag): try: if flag == '0': # 사용자 생성 f.sign_in() elif flag == '1': # 회사 만들기 f.makecom() elif flag == '2': # 출 퇴근 정보 저장 f.inout() elif flag == '3': # qr 코드 출 퇴근 정보 저장 f.qrinout() elif flag == '4': # 로그인 정보 대조 f.login() elif flag == '5': # 라즈베리 파이 단말기 로그인 대조 f.raslogin() return '1' except Exception as ex: return '0,' + ex
def login_post(): print(request.method) if request.method == "POST": username = request.form['username'] password = request.form['password'] hash_value = function.login(username, password) if hash_value: session['s'] = hash_value return "true" else: return "false" return render_template("login.html")
def index(): '''主页的视图函数''' if request.method == 'GET': # try: # use_times=r.get("use_times").decode() # except Exception as e: # print(e) #return render_template("index.html",use_times=use_times) return render_template("index.html") else: username = request.form.get("username") password = request.form.get("password") if username == '' or password == '': return "请输入学号或密码" s = login(username, password) if s == 'fail': return "<h1>账号或密码错误!</h1>" #多线程评教评教的过程 thread_ping = threading.Thread(target=pingjiao, args=(s, )) thread_ping.start() # pingjiao(s) return '<h1>评价成功!</h1> \n <h2> <a href="http://ids.chd.edu.cn/authserver/login?service=http%3A%2F%2Fbkjw.chd.edu.cn%2Feams%2Fhome.action%3Bjsessionid%3D3ECA527C2DF78DA0D88DB231959FF11D">教务链接</a></h2>'
now_day = int(time.strftime("%d", time.localtime(time.time()))) if now_day >= 10: lixi = (now_day - 10) * 0.05 else: lixi = (now_day + 20) * 0.05 from function import login card = raw_input("请输入信用卡帐号:") pkl_file = open("account_info.pkl", "rb") db_dict = pickle.load(pkl_file) pkl_file.close() b = login(db_dict, card) # print "当前余额 %s" % b[2] print "取现请按1\n查询请按2\n还款请按3\n转账轻按4\n退出请按5" c = raw_input("请输入编号:") if int(c) == 1: d = int(raw_input("请输入取款金额:")) if d > b[2]: print "超出限额请重新输入" else: # shouxu = d*0.005 b[2] = int(b[1]) - int(d) - int(d) * 0.05 print str(b[2]) print b db_dict[card] = b print db_dict b[2] = str(b[2])
#!/usr/bin/env python #coding:utf-8 from function import login card= raw_input('Please input yout cardcode:') if login(card): ''' def login(code): f = file('code.txt') dict = {} i = 3 for line in f.readlines(): a = line.strip().split('\t') dict[a[0]] = a[1] #if dict.has_key(code): return dict else: return False password =raw_input('please input your pass:'******'password is right!' else:
import json from pathlib import Path from shutil import move from function import run, login if __name__ == '__main__': if not Path("problem-models-old.json").exists() and Path("problem-models.json").exists(): move("problem-models.json", "problem-models-old.json") session = login(None, None) # set your credential before use. Do not commit it! results = run(None, True, session) with open("problem-models.json", "w") as f: json.dump(results, f)
# coding=utf-8 # 2.7版本 字符串有两种编码格式(Unicode、utf-8) 防止输出错误 # 加载模块 import function if __name__ == '__main__': print('>>>>> 开始程序') # 初始化参数 function.init() # 登录账户 status = function.checkLoginStatus() if not status: print('>>>>> 登录账号') result = False while not result: result = function.login() # 设置查询参数 print('>>>>> 初始化信息') function.inputCheckInfo() function.inputTrainInfo() function.inputSeatInfo() function.getTravers() # 开始查询余票 print('>>>>> 查询余票') function.timerDelay()
import mariadb import dbcreds import function while True: print("1. Login") print("2. Sign Up") print("3. Exit") select = input("Please select your choice.") print() if select == "1": username = input("Please type your username: "******"Please type your password: "******"1. Enter a new exploit") print("2. Read your exploit") print("3. Modify your exploit") print("4. Read other hacker's exploit") print("5. Modify your account") print("6. Exit") exploit_select = input("Please input your selection.") print() if exploit_select == "1": print("Please input your content.") content = input() function.post("username, content") elif select == "2": username = input("Please type your username: ") while True: