def perform(mode, rate, noans_num): #处理账号信息 print(COLOR.DISPLAY + 'Welcome To Multi-Autocx!' + COLOR.END) # 读取 手机号+密码 弹出多个弹窗 lt_phone = getlogindata_phone() for i in range(len(lt_phone) // 2): logindata = "" try: for j in range(i * 2, (i + 1) * 2): logindata += (lt_phone[j].strip(' \n')) + ',' except IndexError: print(' Sorry,no info') break # print(logindata) # args_lt = 'python3 ./login_courses.py '+logindata[0:-1]+' '+str(mode)+' '+str(rate)+' &' args_lt = [ 'python3', 'login_courses.py', logindata[0:-1], str(mode), str(rate), str(noans_num), '&' ] sub_ps = StartAutoCX(args_lt) sub_ps.work() sleep(2) # 读取 机构账号 需要输入验证码 每次处理一个 按任意键后处理下一个 lt = getlogindata() for i in range(len(lt) // 3): logindata = "" try: for j in range(i * 3, (i + 1) * 3): logindata += (lt[j].strip(' \n')) + ',' except IndexError: print(' Sorry,no info') break # print(logindata) args_lt = [ 'python3', 'login_courses.py', logindata[0:-1], str(mode), str(rate), str(noans_num), '&' ] sub_ps = StartAutoCX(args_lt) sub_ps.work() sleep(2) #input(COLOR.OK+' please press any key to continue'+COLOR.END) print(COLOR.DISPLAY + 'Now you can exit this program! Good luck!' + COLOR.END)
def perform(mode, rate): #处理账号信息 print(COLOR.DISPLAY + 'Welcome To Multi-Autocx!' + COLOR.END) # 读取 手机号+密码 弹出多个弹窗 lt_phone = getlogindata_phone() for i in range(len(lt_phone) // 2): logindata = "" try: for j in range(i * 2, (i + 1) * 2): logindata += (lt_phone[j].strip(' \n')) + ',' except IndexError: print(' Sorry,no info') break # print(logindata) Popen('start cmd /k python login_courses.py ' + logindata[0:-1] + ' ' + str(mode) + ' ' + str(rate), shell=True) sleep(2) # 读取 机构账号 需要输入验证码 每次处理一个 按任意键后处理下一个 lt = getlogindata() for i in range(len(lt) // 3): logindata = "" try: for j in range(i * 3, (i + 1) * 3): logindata += (lt[j].strip(' \n')) + ',' except IndexError: print(' Sorry,no info') break # print(logindata) Popen('start cmd /k python login_courses.py ' + logindata[0:-1] + ' ' + str(mode) + ' ' + str(rate), shell=True) input(COLOR.OK + ' please press any key to continue' + COLOR.END) print(COLOR.DISPLAY + 'Now you can exit this program! Good luck!' + COLOR.END) sleep(1.5)
except: pass print(COLOR.OK + ' LOGIN_FINISHED' + COLOR.END) menu_url = courses_lt[course_id - 1][1] course_name = courses_lt[course_id - 1][0] singlecourse = SC(self.driver, menu_url, course_name, self.pattern, self.rate, self._sc_out_fp) singlecourse.work() if __name__ == "__main__": if len(argv) == 1: #logindata = getlogindata() logindata = getlogindata_phone()[0:2] mode = 0 rate = 1 noans_num = 5 else: logindata = (argv[1]).split(',') mode = int(argv[2]) rate = eval(argv[3]) noans_num = eval(argv[4]) QA = QueryAns() QA.noans_num = noans_num try: process = Login_courses_by_request(logindata, mode, rate) # process = Login_courses_by_chrome(logindata,mode,rate) #备用登录选项 process.work() except SystemExit: