def pilih(): login() print(">>>>>>PILIH MENU<<<<<<") print( "\n\t***pilihan***\n\t1. Nilai\n\t2. Gaji\n\t3. Biaya\n\t4. Kalkulator\n\t5. exit" ) pilih = input("\n\tsilahkan pilih:") if pilih == "1": nilai() lagi() elif pilih == "2": gaji() lagi() elif pilih == "3": biaya() lagi() elif pilih == "4": kalkulator() lagi() elif pilih == "5": exit print("\n\t*****TERIMA KASIH*****") else: exit print("\n\t*****TERIMA KASIH*****")
def test02(self): u''' 普通运营正确帐号密码登录''' self.username="******" self.password="******" (self.code,self.roleid)=login.login(self.host,self.username,self.password) self.assertEquals(self.code,0) self.assertEquals(self.roleid,5)
def test03(self): u''' 销售主管正确帐号密码登录''' self.username="******" self.password="******" (self.code,self.roleid)=login.login(self.host,self.username,self.password) self.assertEquals(self.code,0) self.assertEquals(self.roleid,3)
def test04(self): u''' 普通销售正确帐号密码登录''' self.username="******" self.password="******" (self.code,self.roleid)=login.login(self.host,self.username,self.password) self.assertEquals(self.code,0) self.assertEquals(self.roleid,6)
def test01(self): u''' 运营主管正确帐号密码登录''' self.username="******" self.password="******" (self.code,self.roleid)=login.login(self.host,self.username,self.password) self.assertEquals(self.code,0) self.assertEquals(self.roleid,4)
def test_1(self,canshu): u''' 运营主管正确帐号密码登录''' print(canshu) self.username=canshu["username"] self.password=canshu["psw"] (self.code,self.roleid)=login.login(self.host,self.username,self.password) self.assertEquals(self.code,0)
def main(_driver, _params): # 登录 if not login(_driver, _params): sys.exit(-1) # 查询 if not ticket_remain(_driver, _params): sys.exit(-1) # 预订 submit_book(_driver, _params)
def process(user_id, user_password, email=''): """ do a single evaluation task :param user_id: your user_id like '201*****48' :param user_password: your user_password I don't recommend user space in password :param email: email address to send the info of your task :return: """ try: s = login(user_id, user_password) except ConnectionError: print(f"{user_id} Error") return f"{user_id} failed" except Exception as e: message = str(e) else: message = evaluate(s) print(f"{user_id} 自动评价结果,{message}") print("---------------------------") # from mail import send_mail # if email: # send_mail(send_tos=[email], name="SSSimon Yang", subject=f"{user_id} 自动评价结果", # text=message) return f"{user_id} success"
def login(): login.login("redacted") '''
def login(self): self.login = login(self)
from selenium import webdriver from login.login import login import os #引入chromedriver.exe chromedriver = "C:\Program Files (x86)\Google\Chrome\Application\chromedriver.exe" os.environ["webdriver.chrome.driver"] = chromedriver browser = webdriver.Chrome(chromedriver) ##登录 login().user_login(browser) print("登录成功") #sleep(10) #退出 login().user_logout(browser) print("退出成功") #关闭浏览器 #sleep(10) login().quitt(browser) print("关闭成功")
def loginEmployee(): user = User.json_parse(request.json) # Bad practice here returned_user = login.login(user) return jsonify(returned_user)
def login(request): resp = func.login(request) return HttpResponse(resp)
conn.commit() def task_rank(): c.execute( 'SELECT github_user_name, chap1_time FROM submit_issue ORDER BY chap1_time' ) c.execute( 'UPDATE submit_issue SET ch1_rank = ?, ch2_rank = ? WHERE , ch3_rank, ch4_rank, ch5_rank, ch6_rank, ch7_rank)' ) if __name__ == '__main__': argv = login.login() USERNAME = argv[0] PASSWORD = argv[1] conn = sqlite3.connect(DATABASE) c = conn.cursor() c.execute( 'CREATE TABLE submit_issue (github_user_name TEXT, area TEXT, chap1_time TEXT, chap2_time TEXT, chap3_time TEXT, chap4_time TEXT, chap5_time TEXT, chap6_time TEXT,chap7_time TEXT, ch1_rank TEXT,ch2_rank TEXT,ch3_rank TEXT,ch4_rank TEXT,ch5_rank TEXT,ch6_rank TEXT,ch7_rank TEXT)' ) print("Table created successfully") for stu in get_stu_index(): c.execute( 'INSERT INTO submit_issue (github_user_name, area) VALUES (?,?)', (stu[0], stu[1]))
else: print('No valid Webdrive was provided. ') driver.set_window_size(1440, 1200) driver.implicitly_wait(CONFIG.waittime) sleep(2) host = CONFIG.HOST # start Demo script # login with standar threatq user. driver.get("https://chart-sr.threatq.com/") login.login(host, driver, usr=CONFIG.USER[0], pssword=CONFIG.USER[1]) sleep(3) # open Advanced-Search UI driver.find_element_by_css_selector("i.fas.fa-search").click() driver.find_element_by_link_text("Early access to our new search").click() sleep(4) # Add Swift and Finance to keyword search driver.find_element_by_id("advancedSearchMention").clear() driver.find_element_by_id("advancedSearchMention").send_keys("Swift") # driver.find_element_by_id("advancedSearchMention").send_keys(${KEY_ENTER}) driver.find_element_by_id("advancedSearchMention").send_keys(Keys.ENTER)
from bottle import route, run, static_file, post, request, response, redirect from utility.utility import menu, css from chess.chess import chess from chess.dashboard_chess import dashboard_chess from login.login import login d = dashboard_chess() l = login() @route('/chess/black/<email>') def chess_black(email = -1): u = request.get_cookie('username','', secret='the sercet') c1 = chess(u, email) d.add(c1) redirect("/dashboard/" + str(c1.random_chess)) @route('/chess/white/<email>') def chess_white( email = -1 ): u = request.get_cookie('username','', secret='the sercet') c1 = chess(email, u) d.add(c1) redirect("/dashboard/" + str(c1.random_chess)) @route('/chess/new/<email>') def chess_new(email = -1): r = '' r += '<html>\n' r += '<head>\n'
__author__ = 'liuWei' from login import login #print(login.getLoginHtml()) #print(login.getVerifyCode()) print(login.login()) ''' def printType(self, dataType, r): if dataType == 'text': #响应内容 '' elif dataType == 'json': #Json数据 print(r.json()) elif dataType == 'url': #打印输出该 URL '' elif dataType == 'content': #获取二进制数据 '' elif dataType == 'status_code': #响应状态码 '' elif dataType == 'raise_for_status': #检查请求是否成 '' elif dataType == 'history': #如果你使用了 HEAD,你也可以启用重定向 ''