Пример #1
0
def userInputNumPartsArrange():
    """
    Function, userInputNumPartsArrange() performs certain tasks:

        1. userInput_arrange will return a list of tuples includes the data which is arraged from
            userInput_numList and userInput_partsList.
        2. The all user input data will be shown in the table format with help of class
           UserInputPow's function, printing_asking_valuesandparts().
        3. userDataArranged_Sending will append the data which will be returned from class
            UserInputPow's function, user_pow_fn().
        4. userInput_FinalData uses reduce & lambda function to get the multiply of all the numbers.
        5. In the end, this function will show the very first user input and the final output.
    """
    print("\nYou're going to see your all inputs in 2 seconds...\n")
    sl(2)
    userInput_arrange = list(zip(userInput_NumList, userInput_PartsList))

    print("\tNumber\tParts\tTotal\tpow_data")
    for i in userInput_arrange:
        userDataArranged_Sending = UserInputPow(*i)
        userDataArranged_Sending_X = userDataArranged_Sending.user_pow_fn()

        print(userDataArranged_Sending.printing_asking_valuesandparts())
        userInput_DataArrangement.append(userDataArranged_Sending_X)
    userInput_FinalData = reduce(lambda x, y: x * y, userInput_DataArrangement)
    print(
        f"\nFinal Data:\t\t {askingUserInput.userInput} \t  {userInput_FinalData}"
    )
Пример #2
0
    def __init__(self, joueur_a, joueur_b):
        self.joueur_a = joueur_a
        self.joueur_b = joueur_b

        score_joueur_a = 2
        score_joueur_b = 2
        print("\n---------------------------")
        while score_joueur_a == 2:
            try:
                score = int(input("\nScore du joueur {}\n\n1 - Gagnant 1p\
                    \n2 - Perdant 0p\n3 - Match nul 1/2p\n\nVotre choix : ".format(joueur_a)))
            except ValueError:
                print("\nVous n'avez pas saisi une valeur valide.")
                sl(2)
                continue
            if score == 1:
                score_joueur_a = 1
                score_joueur_b = 0
                break
            if score == 2:
                score_joueur_a = 0
                score_joueur_b = 1
                break
            if score == 3:
                score_joueur_a = 0, 5
                score_joueur_b = 0, 5
                break
        self.score_joueur_a = score_joueur_a
        self.score_joueur_b = score_joueur_b
Пример #3
0
def multi_player(character):

    if character not in ["X", "O"]:
        print("That is not a valid character")
        input("Press enter to restart")
        main()

    while True:
        print_board()
        check_winner()
        try:
            print("It is player " + character + "'s turn")
            columnplace = int(
                input("In which column would you like to place " + character +
                      "?\n>> "))
            rowplace = int(
                input("In which row would you like to place " + character +
                      "?\n>> "))
            for space in spaces:
                if space.row == rowplace and space.column == columnplace:
                    if space.occupied:
                        print("That space is already occupied")
                    else:
                        space.place(character)
                        if character == "X":
                            character = "O"
                        else:
                            character = "X"
                    break
        except ValueError:
            print("That is not a row number")
        sl(.5)
Пример #4
0
def news():
    # the target we want to open
    url = 'http://www.hindustantimes.com'

    #open with GET method
    resp = requests.get(url)

    #http_respone 200 means OK status
    if resp.status_code == 200:
        print("Successfully opened the web page. \n")
        sl(1)
        print("The news are as follow :-\n")

        # we need a parser,Python built-in HTML parser is enough .
        soup = BeautifulSoup(resp.text, 'html.parser')

        # l is the list which contains all the text i.e news
        l = soup.find("div", {"class": "new-topnews-left"})
        #this was ad hoc experiment, as some news was getting left out
        z = soup.find("div", {"class": "container border-bottom pb-20 mt-30"})

        #now we want to print only the text part of the anchor.
        #find all the elements of a, i.e anchor
        for i in l.findAll("a"):
            print(i.text)
        #repeated the function for z part of the page
        for i in z.findAll("a"):
            print(i.text)
    else:
        print("Error")
def main():
    """
    main driver for the test itself,
    Calls testing functions with args from get_test_configuration func.
    """

    # setting current test parameters from db
    this_test = get_test_configuration()
    USER_NAME, APP_PATH = (this_test['User'], this_test['Gateway'])

    # left for posteriry / more than 1 running servers
    APP_PATH = APP_PATH + str(UID)

    # Waiting a bit to make sure docker-compose is done
    sl(3)

    print('--==> DOCKERIZED SERVER TEST VERSION <==--')
    print(f"Testing with UID {UID} as {USER_NAME}...\n\nProgress:")
    try:
        post_2_db_api(APP_PATH, USER_NAME)
        get_from_db_api(APP_PATH, USER_NAME)
        get_from_mysql(UID, USER_NAME)
        print("\nAll tests successful!\n")

    # Always cleanup db
    finally:
        print("Cleaning up after tests... ", end='')
        cleanup(UID)
Пример #6
0
 def crawl_specific_forum(self,name):
     forumlist=self.get_forumList()
     for i in forumlist:
         if i.split(",")[0] in name:
             link = i.split(",")[1]
             break
     else:
         self.__close()
         return "無此看板"
     self.__drivrer.get(link)
     sl(0.5)
     r_list=self.__drivrer.find_elements_by_xpath('//*[@id="__next"]/div[2]/div[2]/div/div/div/div[2]/div[2]/div/div[1]/div')
     xStr=""
     for artical in r_list:
         try:
             title ="標題:" + artical.find_element_by_xpath('./article/h2/a/span').text
             href ="連結:" + artical.find_element_by_xpath('./article/h2/a').get_attribute('href')
             motion ="心情:" + artical.find_element_by_xpath('./article/div[4]/div[1]/div/div[2]').text
             response ="回應" +artical.find_element_by_xpath('./article/div[4]/div[2]/span[2]').text
             articleString = "\n".join([title,href,motion,response])
             xStr += articleString + "\n" + ('-'*28)+"\n"
         except Exception as e:
             pass
     self.__close()
     return xStr
Пример #7
0
def get_counts(genedict,chroms,out,site,name):
    outfile = open(out,"w")
    pnames = ["gene","prom","prom_extended"]
    cnames = ["points","fuzzes","occupancys","positions"]
    regions_list = {"gene":[],"prom":[],"prom_extended":[]}
    stat_type_list = {"points":[],"fuzzes":[],"occupancys":[],"positions":[]}
    change_dict = {}
    for i in pnames:
        change_dict[i] = {}
        for j in cnames:
            change_dict[i][j] = []
    print change_dict
    for gene in genedict:
        for pos in pnames:
            for stat in cnames:
                if len(genedict[gene][pos][stat]) > 0:
                    for c in genedict[gene][pos][stat]:
                        name = chroms[gene].replace("_A_nidulans_FGSC_A4","") + "_" + str(c[3])
                        change_dict[pos][stat].append(name)
                        regions_list[pos].append(name)
                        stat_type_list[stat].append(name)
                        if name in site[stat]:
                            site[stat].remove(name)
    outfile.write('\t'+'\t'.join(cnames)+'\n')
    for pos in pnames:
        outfile.write(pos)
        for stat in cnames:
            outfile.write('\t'+str(len(set(change_dict[pos][stat]))))
        outfile.write('\n')
    outfile.write("intergenic")
    for stat in cnames:
        outfile.write('\t' + str(len(set(site[stat]))))
    outfile.write('\n')
    outfile.close()

    nregions_list = {}
    for l in regions_list:
        nregions_list[l] = list(set(regions_list[l]))
    regions_list = nregions_list
    nstat_type_list = {}
    for l in stat_type_list:
        nstat_type_list[l] = list(set(stat_type_list[l]))
    stat_type_list = nstat_type_list

    for p in regions_list:
        print p, regions_list[p][:10]
        sl(0.2)
        outf = open("/Volumes/MP_HD/Linda_MNase_Seq/DANPOS_4_way/danpos_raw_output/4_stats_4_cats/"+name+"_all_changed_"+p+"position_nucleosomes.txt",'w')
        outf.write('\n'.join(regions_list[p]))
        outf.close()

    for p in stat_type_list:
        outf = open("/Volumes/MP_HD/Linda_MNase_Seq/DANPOS_4_way/danpos_raw_output/4_stats_4_cats/"+name+"_"+p+"_changed_all_position_nucleosomes.txt",'w')
        outf.write('\n'.join(stat_type_list[p]))
        outf.close()

    fuz_occ_ls = set(stat_type_list["fuzzes"]).intersection(stat_type_list["occupancys"])
    outf = open("/Volumes/MP_HD/Linda_MNase_Seq/DANPOS_4_way/danpos_raw_output/4_stats_4_cats/"+name+"_fuzzys_and_occupancys_changed_all_position_nucleosomes.txt",'w')
    outf.write('\n'.join(fuz_occ_ls))
    outf.close()
Пример #8
0
def menu_tournoi():
    valeur_quitter = 0
    while valeur_quitter != 1:
        sys(OutilsControleurs.which_os())
        print("\nMenu gestion des tournois: ")
        print(
            "\n1 - Liste des tournois\n2 - Reprise d'un tournoi\n3 - Retour\n4 - Quitter"
        )
        try:
            choix_menu_tournoi = int(input("\nVotre choix: "))
        except ValueError:
            print("\nVous n'avez pas saisi un chiffre.")
            sl(2)
            continue
        if choix_menu_tournoi == 1:
            print("\n---------------------------\n")
            liste_tounois = Tournoi.tournois_liste()
            if liste_tounois == 0:
                print(
                    "Il n'y a aucun tournois d'enregistrer, veuillez ajouter un tournoi via le menu."
                )
                input("\nAppuyer sur entrer pour continuer")
                return
            for arg in liste_tounois:
                print(arg)
            input("\nAppuyer sur entrer pour continuer")
        if choix_menu_tournoi == 2:
            print("\n---------------------------\n")
            x = 1
            liste_tounois = Tournoi.tournois_liste()
            if liste_tounois == 0:
                print(
                    "Il n'y a aucun tournois d'enregistrer, veuillez ajouter un tournoi via le menu."
                )
                input("\nAppuyer sur entrer pour continuer")
                return
            for arg in liste_tounois:
                print("Indice tournoi : {}\n{}".format(x, arg))
                x += 1
            choix_tournoi_reprise = 0
            while choix_tournoi_reprise == 0:
                try:
                    choix_tournoi_reprise = int(
                        input("\nSelectionnez un tournoi : "))
                except ValueError:
                    print("\nVous n'avez pas saisi un chiffre.")
            data_tournoi_reprise = Tournoi.get_data_tournoi(
                choix_tournoi_reprise)
            joueurs_tournoi_reprise = Tournoi.get_joueurs_tournoi_reprise(
                data_tournoi_reprise)
            # nb de tours
            gestion_tournoi = GestionTournoi(1, joueurs_tournoi_reprise,
                                             choix_tournoi_reprise)
            gestion_tournoi.gestion_tournoi()
        if choix_menu_tournoi == 3:
            return
        if choix_menu_tournoi == 4:
            instance_class = OutilsVues()
            instance_class.quitter()
Пример #9
0
 def hooker(t):
     if t['status'] == 'downloading':
         sys.stdout.flush()
         sys.stdout.write('\r' + get_colors.red() +'[' + get_colors.cyan() +'+' + get_colors.red() + ']' + get_colors.randomize1() + ' Progress ' + get_colors.randomize() + str(t['_percent_str']))
         sl(0.1)
     elif t['status'] == 'finished':
         try: dict = directory[0]
         except: dict = None
         download.get_current_dir(t['filename'],dict)
Пример #10
0
def message(text, timeout):
    from os import system as cmd
    from time import sleep as sl
    doneletters = []
    sl(1)
    for var in text[0:len(text) - 1]:
        print(listtostr(doneletters) + var)
        sl(timeout)
        cmd('cls')
        doneletters.append(var)
    print(listtostr(doneletters) + text[text.index(var) + 1])
Пример #11
0
 def animation(timing='1234',begin=True):
     done = begin
     # for c in itertools.cycle(['|', '/', '-', '\\']):
     for c in range(1,10):
             if done:
                 break
             sys.stdout.write('\rTime Is ' + str(c) + timing)
             sys.stdout.flush()
             sl(0.1)
     sys.stdout.write('\rDone!     ')
     done = True
Пример #12
0
            def satisfaction():
                stf = msg.askyesno("Customer Satisfaction", "Please tell us if you are satisfied or not." )

                if stf == True:
                    thnks = msg.showinfo("CafeCliche", "Thank-you for your trust in us.")
                    sl(0.7)
                    qrs.destroy()

                if stf == False:
                    msg.showinfo("Customer Satisfaction", "Please register your Complaints at the following number:\n                              0303-5220280")
                    sl(1)
Пример #13
0
    def parsePage(self):
        #新增csv文件,寫入爬取過程的狀態
        for i in range(31):
            if i == 0:
                with open("txStatus.csv", "a+", newline="") as f:
                    writer = csv.writer(f)
                    writer.writerow(["date", "status"])
            try:
                #獲取內容節點對象列表
                r_list = self.driver.find_elements_by_xpath(
                    '//div[@id="printhere"]/table/tbody/tr[2]/td/table[2]/tbody/tr'
                )
                #獲取日期的節點對象
                date = self.driver.find_element_by_xpath(
                    '//div[@id="printhere"]/table/tbody/tr[2]/td/h3')
                dateString = re.findall(r'\d+[/]\d+[/]\d+', date.text)[0]
                print(dateString, "crawler walking now")
                x_list = []
                for r in r_list:
                    x_list.append(r.text.split())
                #定義標題列表
                title_list = x_list[0]
                #合併相關標題
                title_list[1] = "".join(title_list[1:4])
                del title_list[2:4]
                title_list[5] = "".join(title_list[5:7])
                del title_list[6]
                #標題欄新增日期
                title_list.append("日期")

                del x_list[-1]
                x_list = [i + [dateString] for i in x_list]

                #存進Mongo數據庫
                self.saveToMongo(x_list, title_list)
                print(dateString, "insert to Mongo success!")
                with open("txStatus.csv", "a+", newline="") as f:
                    writer = csv.writer(f)
                    writer.writerow([dt.now(), "sucess"])
                #跳轉到後一日
                button = self.driver.find_element_by_id("button4")
                button.click()
                sl(2)

            #例假日沒有期貨資訊,用except接收異常
            except Exception as e:
                with open("txStatus.csv", "a+", newline="") as f:
                    writer = csv.writer(f)
                    writer.writerow([dt.now(), "error:" + str(e)])

                button = self.driver.find_element_by_id("button4")
                button.click()
                sl(2)
Пример #14
0
def askingUserInput():
    """
    This function, askingUserInput() will ask user to input an integer for
    further actions with a warning.
    """
    print("\nNOTE: Read the rules, continued in 3 seconds... \
           \nKeep the range in mind after entering. \
           \nIf your limit crossed your input then you'll have to restart or exit thr program. \
           \nEx. If you entered 100 then it shouldn't be more than 100.\n")
    sl(3)
    askingUserInput.userInput = int(input("Enter a number: "))

    return askingUserInput.userInput
Пример #15
0
def main(timesleep, tier, ores_per):
    from time import sleep as sl
    ores = []
    print('Hit CTRL+C to stop mining')
    while True:
        try:
            sl(timesleep)
            for i in range(1, ores_per + 1):
                ores.append(percent(f"pickaxe tier {tier}"))
            print(f'Ores mining:{ores[-1]},Ores Mined:{len(ores)}')
            print(ores)
        except KeyboardInterrupt as e:
            print('Done Mining!')
    return ores
Пример #16
0
def main():
    game_type = input(
        "\033[H\033[2JWould you like to play single player or multiplayer? (1/2)\n>> "
    )
    if game_type == "1":
        single_player(
            input("What character would you like to be? (X/O)\n>> ").title())
    elif game_type == "2":
        multi_player(
            input("Which character will be going first? (X/O)\n>> ").title())
    else:
        print("That is not a valid game type. Please try again")
        sl(.5)
        main()
Пример #17
0
def banner3():
    files = ['cat1.txt','cat2.txt','cat3.txt','cat4.txt','cat5.txt','cat6.txt']
    frames = []
    for file in files:
        if platform == "linux":
            with open(f'{path}/src/ascii/{file}','r') as f:
                frames.append(f.readlines())
        else:
            with open(f'{path}\\src\\ascii\\{file}','r') as f:
                frames.append(f.readlines())
    for i in range(0,2):
        for frame in frames:
            print(get_colors.randomize() + "".join(frame) + "     " + get_colors.randomize1() + "I'm Spinning")
            sl(0.01)
            clear()
Пример #18
0
 def input1():
     input2 = input(Fore.RED + "[+] Do you want to create a " +
                    get_colors.sharp_green() + "new database" +
                    get_colors.bright_megento() + " or" +
                    get_colors.orange() + " use previous one" +
                    get_colors.yellow() + get_colors.white() +
                    " [N/O]: ")
     if input2 in ['n', 'N']:
         Pass_key.get_creds()
         sl(5)
         os.system('clear')
     elif input2 in ['O', 'o']:
         Pass_key.creds_append()
     else:
         print(Fore.RED + "[!] Unknown Options")
         input1()
Пример #19
0
 def sauvegarde(self, *args):
     while self.reponse != 2 or self.reponse != 1:
         sys(OutilsControleurs.which_os())
         for n in args:
             print(n)
         print("\n---------------------------")
         try:
             self.reponse = int(input("\nVoulez-vous vraiment sauvegarder ?\n\n1 - Oui\n2 - Non\n\nVotre choix: "))
         except ValueError:
             print("\nVous n'avez pas saisi un chiffre.")
             sl(2)
             continue
         if self.reponse == 1:
             return 1
         if self.reponse == 2:
             return 0
Пример #20
0
 def quitter(self):
     while self.reponse != 2 or self.reponse != 1:
         sys(OutilsControleurs.which_os())
         try:
             self.reponse = int(input("\nEtes-vous sûr de vouloir quitter le programme ?\
                 \n\n1 - Oui\n2 - Non\n\nVotre choix: "))
         except ValueError:
             print("\nVous n'avez pas saisi un chiffre.")
             sl(2)
             continue
         if self.reponse == 1:
             report()
             sys(OutilsControleurs.which_os())
             quit()
         if self.reponse == 2:
             return 0
Пример #21
0
def countdown():

    global timeleft

    # if a game is in play
    if timeleft > 0:

        # decrement the timer.
        timeleft -= 1

        # update the time left label
        timeLabel.config(text="Time left: " + str(timeleft))

        # run the function again after 1 second.
        timeLabel.after(1000, countdown)
    else:
        sl(1)
        root.destroy()
Пример #22
0
def single_player(character):

    if character == "X":
        computer_character = "O"
    elif character == "O":
        computer_character = "X"
    else:
        print("That is not a valid character")
        input("Press enter to restart")
        main()

    while True:
        possible_locations = []
        print_board()
        check_winner()
        try:
            columnplace = int(
                input("In which column would you like to place " + character +
                      "?\n>> "))
            rowplace = int(
                input("In which row would you like to place " + character +
                      "?\n>> "))
            for space in spaces:
                if space.row == rowplace and space.column == columnplace:
                    if space.occupied:
                        print("That space is already occupied")
                    else:
                        space.place(character)
                    break
        except ValueError:
            print("That is not a row number")

        print_board()
        sl(.5)
        check_winner()

        for space in spaces:
            if not space.occupied:
                possible_locations.append(space)
        random.choice(possible_locations).place(computer_character)

        sl(.5)
Пример #23
0
def kullanici_giris(imlec, db):

    imlec.execute("SELECT * FROM Login")

    Id = imlec.fetchall()

    os.system("clear")

    print("\n  DEMIR Hastane Otomasyonu - Personel Giriş")

    idd = input("\n\n    ID = ")

    sifre = input("\n\n    Sifre = ")

    sifreleyici = hasher.sha256()
    sifreleyici.update(sifre.encode("utf-8"))
    hash = sifreleyici.hexdigest()

    kontrol = None

    for i in Id:

        if i[0] == idd and i[1] == hash:

            kontrol = True

    if kontrol == True:

        print("\n\n     Giriş başarılı...")
        sl(5)

        return 1

    else:

        input(
            "\n\n     Kullanıcı adı veya sifre hatalı,\n    Ana menüye dönmek için Enter'e basınız."
        )

        return 0
Пример #24
0
def random():
    rand = ran(0, 100)
    if rand <= 20:
        pygame.mixer.music.load('voz1.mp3')
        pygame.mixer.music.play()
        sl(1.3)
    elif rand <= 40:
        pygame.mixer.music.load('voz2.mp3')
        pygame.mixer.music.play()
        sl(0.8)
    elif rand <= 60:
        pygame.mixer.music.load('voz3.mp3')
        pygame.mixer.music.play()
        sl(0.6)
    elif rand <= 80:
        pygame.mixer.music.load('voz4.mp3')
        pygame.mixer.music.play()
        sl(1.2)
    else:
        pygame.mixer.music.load('voz5.mp3')
        pygame.mixer.music.play()
        sl(1.3)
Пример #25
0
 def Display_game(self):
     sl(0.01)
     if platform == "linux" or platform == "linux2":
         os.system("clear")
     elif platform == "win32":
         os.system('cls')
     #sl(0.1)
     Nvar_num = len(self.List_real_row_elems_count)
     print("\n\n\tTotal Number of boxes -> (%d x %d) => %d" %
           (Nvar_num, Nvar_num, Nvar_num**2))
     print("\n\t           Current game instance => %d" %
           (self.Nvar_game_instance))
     self.Nvar_game_instance += 1
     print("\n\n")
     for i in range(len(self.List_ULTIMATO_COMBO_ELEMS)):
         elem = list(self.List_ULTIMATO_COMBO_ELEMS[i][4].values())[0]
         print(elem, " ", end="")
         if (i + 1) % (len(self.List_real_row_elems_count)) == 0:
             print("")
     sl(0.01)
     self.Birth_and_death_io()
     """
Пример #26
0
    def process_request(self, request, spider):
        # Called for each request that goes through the downloader
        # middleware.

        # Must either:
        # - return None: continue processing this request
        # - or return a Response object
        # - or return a Request object
        # - or raise IgnoreRequest: process_exception() methods of
        #   installed downloader middleware will be called
        with open('./count.txt', "a+") as f:
            f.write(str(self.__count) + "\n")
        self.__driver.get(request.url)
        logging.info('go to dcard website')
        for i in range(self.__count):
            self.__driver.execute_script('scroll(0,5000);')
            sl(2)
        self.__count += 1
        sl(2)
        render_body = self.__driver.page_source
        logging.info('page load complete')
        return HtmlResponse(request.url, body=render_body, encoding='utf-8')
Пример #27
0
    def run():
        banner()
        user_option = input(Fore.CYAN + "[+] Do you want to " +
                            Fore.LIGHTGREEN_EX + " [view] " + Fore.CYAN +
                            "or" + Fore.LIGHTMAGENTA_EX + " [add data] " +
                            Fore.CYAN + "or" + Fore.LIGHTYELLOW_EX +
                            " [encrypt a data file] " + Fore.CYAN +
                            "[V/A/E]: ")
        if user_option in ["A", 'a']:

            def input1():
                input2 = input(Fore.RED + "[+] Do you want to create a " +
                               get_colors.sharp_green() + "new database" +
                               get_colors.bright_megento() + " or" +
                               get_colors.orange() + " use previous one" +
                               get_colors.yellow() + get_colors.white() +
                               " [N/O]: ")
                if input2 in ['n', 'N']:
                    Pass_key.get_creds()
                    sl(5)
                    os.system('clear')
                elif input2 in ['O', 'o']:
                    Pass_key.creds_append()
                else:
                    print(Fore.RED + "[!] Unknown Options")
                    input1()

            input1()
        elif user_option in ['V', 'v']:
            Pass_key.decrypt()
            sl(2)
        elif user_option in ['E', 'e']:
            filename = Pass_key.get_filename()[0]
            path = Pass_key.get_path()
            Pass_key.encrypt_file(path, filename)
        else:
            print(Fore.RED + "[!] Unknown Option")
            Pass_key.run()
Пример #28
0
def menu_principal():
    valeur_quitter = 0
    while valeur_quitter != 1:
        sys(OutilsControleurs.which_os())
        print("\nMenu principal: ")
        print(
            "\n1 - Creer un nouveau tournoi\n2 - Joueurs\n3 - Gestion des tournois\n4 - Quitter"
        )
        try:
            choix_principal = int(input("\nVotre choix: "))
        except ValueError:
            print("\nVous n'avez pas saisi un chiffre.")
            sl(2)
            continue
        if choix_principal == 1:
            Tournoi()
        if choix_principal == 2:
            menu_joueur()
        if choix_principal == 3:
            menu_tournoi()
        if choix_principal == 4:
            instance_class = OutilsVues()
            instance_class.quitter()
Пример #29
0
def menu_joueur():
    valeur_quitter = 0
    while valeur_quitter != 1:
        sys(OutilsControleurs.which_os())
        print("\nMenu joueurs: ")
        print(
            "\n1 - Liste des joueurs\n2 - Ajout d'un joueur\n3 - Retour\n4 - Quitter"
        )
        try:
            choix_menu_joueur = int(input("\nVotre choix: "))
        except ValueError:
            print("\nVous n'avez pas saisi un chiffre.")
            sl(2)
            continue
        if choix_menu_joueur == 1:
            menu_joueur_liste()
        if choix_menu_joueur == 2:
            Joueur()
        if choix_menu_joueur == 3:
            return
        if choix_menu_joueur == 4:
            instance_class = OutilsVues()
            instance_class.quitter()
Пример #30
0
def main():
    os.system("clear")
    logo()
    fff = raw_input("msfter > ")
    if fff == "1" or fff == "01":
        print(W + '\n======================================')
        print(G + '[+]' + W + ' Jesus, it will take a lot of time!')
        print(W + '======================================\n')
        install()
        print(W + '=====================================')
        print(G + '[+]' + W + ' Metasploit installed')
        print(G + '[+]' + W + ' Type "' + G + 'msfconsole' + W + '" to start.')
        print(W + '=====================================\n')

    elif fff == "2" or fff == "02":
        yas = raw_input("\nYou sure? (y/n): ")
        if yas == "y":
            os.system("clear")
            print(W + '\n=====================================')
            print(G + '[+]' + W + ' Removing Metasploit')
            print(W + '=====================================')
            remove()
            print(W + '\n=====================================')
            print(G + '[+]' + W + ' Metasploit removed')
            print(W + '=====================================')
            os.system("clear")
            main()
        elif yas == "n":
            os.system("clear")
            main()
        else:
            print(R + '\nERROR' + W + ': Wrong command => ' + yas)
            sl(1)
            os.system("clear")
            main()

    elif fff == "3" or fff == "03":
        print(W + '\n____________________________')
        print(W + '||========================||')
        print(W + '||    Created By ' + B + 'otx2s' + W + '    ||')
        print(W + '||    ----------------    ||')
        print(W + '||From podval with love :3||')
        print(W + '||========================||')
        print(W + '||                        ||')
        print(W + '~~                        ~~\n' + W)
        raw_input("(Press ENTER) ")
        os.system("clear")
        main()
    elif fff == "0" or fff == "00":
        print "\nGoodbye..."
        sl(1)

    else:
        print(R + '\nERROR' + W + ': Wrong command => ' + fff)
        sl(1)
        os.system("clear")
        main()