예제 #1
0
    def new_game_menu(self, player_obj):
        clear()
        print('Enter new character name:\n ')
        new_name = input('->')

        player_obj.name = new_name
        self.start_level(player_obj.level)
예제 #2
0
파일: run.py 프로젝트: Phoenix476/School
def edit_student():
    global students_data

    def student_delete():
        return

    menu = [
        {'text': 'Удалить ученика',
         'func': student_delete
         },
        {'text': 'Перевести в другой класс'}
    ]
    while True:
        clear()
        print("*" * 24)
        print("* Welcome to %s %s *" % (school_data['number'], school_data['type']))
        print("*" * 24)
        for num, student in enumerate(students_data):
            print("%s) %s || %s" % (num + 1, get_full_name(student), student['class']))
        student_num = int(input('Укажите номер ученика(или НОЛЬ, для создания нового): '))
        if 0 < student_num <= len(students_data):
            student = students_data[student_num - 1]
            print("Вы выбрали %s " % get_full_name(student) + '||' + student['class'])
            loop
        else:
            print('Такого номера нет, введите другой номер')
    return
예제 #3
0
def execute_take(item_id):
    """This function takes an item_id as an argument and moves this item from the
    list of items in the current room to the player's inventory. However, if
    there is no such item in the room, this function prints
    "You cannot take that."
    """


    found = False
    room_items = player.current_room['items']
    for item in room_items:
        if item['id'] == item_id:
            if get_inventory_mass() + item['mass'] < 3:
                player.current_room['items'].remove(item)
                player.inventory.append(item)
                found = True
            else:
                clear()
                print('You are carrying too much weight')
                time.sleep(1)

    if not found:
        clear()
        print('You cannot take that.')
        time.sleep(1)
예제 #4
0
def create_teacher():
    utilities.clear()
    print("""
    Adding new teacher!!
    """)
    first_name = input('first name of teacher \n')
    last_name = input('last name of teacher \n')
    sex = input('Enter gender \n')
    dOB = input('Enter date of birth \n')

    new_teacher_data = {
        'firstName': first_name,
        'lastName': last_name,
        'gender': sex,
        'dOB': dOB
    }

    teacher_object = teacher_logic.Teacher(**new_teacher_data)

    print(f"""
    Verify data
        {teacher_object.getFirstName()}
        {teacher_object.getLastName()}
        {teacher_object.getGender()}
        {teacher_object.getDateOfBirth()}
    """)

    new_teacher_data['username'] = teacher_object.username
    new_teacher_data['password'] = teacher_object.password

    ver = input('ENter yes if data is correct')
    if ver.upper() == 'YES':
        teacher_DB.add_teacher(**new_teacher_data)
예제 #5
0
def teacher_home(*args):
    utilities.clear()
    for arg in args:
        for row in arg:
            print(row)
    while True:
        print("""
        welcome teacher

        what u wanna do?

        1. grade student
        2. set security question....
        3. change password
        0. exit
        """)
        choice = int(input('what u wanna do? \n'))
        if choice == 1:
            teacher_methods.grade_student(args[0])
        elif choice == 2:
            teacher_methods.set_security_question(args[0])
        elif choice == 3:
            teacher_methods.change_password(args[3])
        elif choice == 0:
            break
        else:
            print('didnt get that please try again...')
            continue
예제 #6
0
def print_view(asker, view):
    clear()
    lines = fields.get(asker, lines_field(), view)
    for line in lists.iterator(asker, lines):
        s = strings.to_str(asker, line)
        print(s)
    return asker.reply()
예제 #7
0
def execute_command(command):

    """This function takes a command (a list of words as returned by
    normalise_input) and, depending on the type of action (the first word of
    the command: "go", "take", or "drop"), executes either execute_go,
    execute_take, or execute_drop, supplying the second word as the argument.

    """

    if 0 == len(command):
        return

    if command[0] == "go":
        if len(command) > 1:
            execute_go(command[1])
        else:
            print("Go where?")

    elif command[0] == "take":
        if len(command) > 1:
            execute_take(command[1])
        else:
            print("Take what?")

    elif command[0] == "drop":
        if len(command) > 1:
            execute_drop(command[1])
        else:
            clear()
            print("Drop what?")
            time.sleep(2)

    else:
        print("This makes no sense.")
예제 #8
0
파일: Game.py 프로젝트: ProtKsen/pgame
 def talk_with_oracle(self):
     self.oracle_answer_str = ask_oracle(self.player, self.current_island)
     if self.oracle_answer_str:
         print_in_frame('После долгих ритуалов оракул говорит, что ',
                        self.oracle_answer_str,
                        sep='\n')
     clear()
예제 #9
0
def menu_do(menu_x, **kwargs):
    while True:
        clear()
        print("*" * 24)
        print("* Welcome to %s %s *" % (school_data['number'], school_data['type']))
        print("*" * 24)
        print("MENU > ", kwargs.get("sub_menu", ''))
        for number, el in enumerate(menu_x, start=1):
            print("%s. %s" % (number, el["text"]))
        choice = input(": ")
        if not choice:
            if menu != menu_x:
                return
            else:
                print('Если вы случайно нажали Enter, то нажмите 1')
                choice = input('Для выхода нажмите 2\n:')
                if choice == '1':
                    continue
                elif choice == '2':
                    end()
                    return
        menu_select = menu_x[int(choice-1)]
        if menu_select.get("do"):
            if menu_select["do"]():
                return
        else:
            menu_do(menu_select["sub_menu"], sub_menu=menu_select['text'])
예제 #10
0
파일: run.py 프로젝트: Phoenix476/School
def classrooms():
    global teachers_data
    global students_data
    while True:
        clear()
        print("*" * 24)
        print("* Welcome to %s %s *" % (school_data['number'], school_data['type']))
        print("*" * 24)
        print("     MENU > Информация > О классах")
        print("Все классы нашей школы")
        print("||", " || ".join(school_data['classes']), "||")
        print()
        class_room = input("Введите класс, для подробной информации по нему \n"
                           " (или Enter для возврата в предыдущее меню):")
        if class_room in school_data["classes"]:  # FIXME(complete): сообщить, если выбран несуществующий класс
            print("\nИнформация по %s классу:" % class_room)
            # TODO(complete): вывести всех учеников и учителей указанного класса
            id_students_in_class = get_people(students_data, class_room=class_room, school='%s %s' % school)
            id_teachers_in_class = get_people(teachers_data, class_room=class_room, school='%s %s' % school)
            print("     Учителя: %s" % ','.join(['%s %s %s' % (teacher['name'], teacher['middle_name'],
                                                               teacher['surname'])
                                                 for teacher in teachers_data
                                                 if teacher['id'] in id_teachers_in_class]))
            print("     Ученики: %s" % ','.join(['%s %s %s' % (student['name'], student['middle_name'],
                                                               student['surname'])
                                                 for student in students_data
                                                 if student['id'] in id_students_in_class]))
            input("Нажмите Enter для возврата в предыдущее меню")
            # TODO*: Сделать возврат в предыдущее меню(во всех местах программы).
            # TODO(complete):Выход из программы только по пункту "выйти"
            break
        else:
            print('Такого класса нет в школе')
    return
예제 #11
0
def menu_do(menu_x, **kwargs):
    while True:
        clear()
        print("*" * 24)
        print("* Welcome to %s %s *" %
              (school_data['number'], school_data['type']))
        print("*" * 24)
        print("MENU > ", kwargs.get("sub_menu", ''))
        for number, el in enumerate(menu_x, start=1):
            print("%s. %s" % (number, el["text"]))
        choice = input(": ")
        if not choice:
            if menu != menu_x:
                return
            else:
                print('Если вы случайно нажали Enter, то нажмите 1')
                choice = input('Для выхода нажмите 2\n:')
                if choice == '1':
                    continue
                elif choice == '2':
                    end()
                    return
        menu_select = menu_x[int(choice - 1)]
        if menu_select.get("do"):
            if menu_select["do"]():
                return
        else:
            menu_do(menu_select["sub_menu"], sub_menu=menu_select['text'])
예제 #12
0
 def start(self):
     clear()
     #print(self.intro_text)
     #print_level()
     draw_ascii('map.txt')
     #print('\n\n\n\n Press ENTER to continue...')
     a = input()
     self.level_main()
예제 #13
0
파일: menu.py 프로젝트: Azimusss/Azis
def edit():
    clear()
    print("*" * 24)
    print("* Welcome to %s %s *" % (school_data['number'], school_data['type']))
    print("*" * 24)
    print("Menu > Edit")
    input("Нажмите Enter для возврата в предыдущее меню")
    pass
예제 #14
0
def login():
    utilities.clear()
    print("""
    welcome teacher please enter credentials to login

    """)
    username = input('Enter username')
    password = input('Enter password \n enter 0 if forgot password(to reset)')

    general_DB.verify_credentials(username, password, 'teacher')
예제 #15
0
def print_room(room):
    """This function takes a room as an input and nicely displays its name
    and description. The room argument is a dictionary with entries "name",
    "description" etc. (see map.py for the definition). The name of the room
    is printed in all capitals and framed by blank lines. Then follows the
    description of the room and a blank line again. If there are any items
    in the room, the list of items is printed next followed by a blank line
    (use print_room_items() for this). For example:

    >>> print_room(rooms["Office"])
    <BLANKLINE>
    THE GENERAL OFFICE
    <BLANKLINE>
    You are standing next to the cashier's till at
    30-36 Newport Road. The cashier looks at you with hope
    in their eyes. If you go west you can return to the
    Queen's Buildings.
    <BLANKLINE>
    There is a pen here.
    <BLANKLINE>

    >>> print_room(rooms["Reception"])
    <BLANKLINE>
    RECEPTION
    <BLANKLINE>
    You are in a maze of twisty little passages, all alike.
    Next to you is the School of Computer Science and
    Informatics reception. The receptionist, Matt Strangis,
    seems to be playing an old school text-based adventure
    game on his computer. There are corridors leading to the
    south and east. The exit is to the west.
    <BLANKLINE>
    There is a pack of biscuits, a student handbook here.
    <BLANKLINE>


    >>> print_room(rooms["Admins"])
    <BLANKLINE>
    MJ AND SIMON'S ROOM
    <BLANKLINE>
    You are leaning agains the door of the systems managers'
    room. Inside you notice Matt "MJ" John and Simon Jones. They
    ignore you. To the north is the reception.
    <BLANKLINE>

    Note: <BLANKLINE> here means that doctest should expect a blank line.
    """
    clear()
    print('\n' + room['name'].upper() + '\n')
    print(room['description'] + '\n')
    print_room_items(room)
예제 #16
0
def explore_node(asker, root, parents):
    asker.update(is_pointer_now(), root)
    while True:
        #TODO print the parents
        root = asker.refresh(root)
        lines = asker.ask(outline_to_lines(root)).firm_answer
        utilities.clear()
        asker.ask(print_lines_simple(lines))
        c = utilities.getch()
        if c == 'q':
            return asker.reply()
        else:
            root = asker.refresh(root)
            asker.ask(process_char(root, T.from_char(c), parents))
예제 #17
0
def hire_command(player, team, oracle_answer_str, n_island):
    """Hire a team

    Print the list of available pirates.
    Change the number of player's money and
    team's skills in case of hiring."""
    pirates_list = []
    for i in range(7):
        new_pirate = Pirate(NAMES[randint(0, len(NAMES) - 1)],
                            randint(0, n_island + 1), randint(0, n_island + 1),
                            randint(0, n_island + 1), 0)
        skills_sum = new_pirate.logic + new_pirate.power + new_pirate.agility
        new_pirate.salary = randint(max(1, skills_sum - 3), skills_sum + 1)
        pirates_list.append(new_pirate)

    # buy
    exit_from_tavern = False
    while player.money > 0 and exit_from_tavern is False:
        clear()
        print(SEPARATOR)
        print(team.inform)
        print(player.inform)
        print('Ты собираешься плыть на остров ' + str(n_island) + '.', sep='')
        if oracle_answer_str:
            print('Помни, что сказал оракул:\n', oracle_answer_str, sep='')
        print(SEPARATOR)
        print('В таверне сидят:')
        ans = [str(i + 1) for i in range(len(pirates_list) + 1)]
        for i in range(len(pirates_list)):
            print(i + 1, ' - ', pirates_list[i].name, '.\n',
                  'Логика: ', pirates_list[i].logic, ', ',
                  'сила: ', pirates_list[i].power, ', ',
                  'ловкость: ', pirates_list[i].agility, '. ',
                  'Цена найма: ', pirates_list[i].salary,
                  coins(pirates_list[i].salary), sep='')
            print('------------------')
        print(len(pirates_list) + 1, ' - Команда собрана, уйти из таверны')
        print(SEPARATOR)
        player_answer = get_correct_answer(*ans)
        if player_answer == ans[-1]:
            exit_from_tavern = True
        else:
            if player.money >= pirates_list[int(player_answer) - 1].salary:
                team.add_member(pirates_list[int(player_answer) - 1])
                player.money -= pirates_list[int(player_answer) - 1].salary
                pirates_list.pop(int(player_answer) - 1)
            else:
                print('Денег не хватает, у тебя всего ',
                      player.money, coins(player.money))
예제 #18
0
파일: main_menu.py 프로젝트: Azimusss/Azis
def menu_do(menu, **kwargs):
    while True:
        clear()
        print("*" * 24)
        print("* Welcome to Shashki game")
        print("*" * 24)
        print("MENU > ", kwargs.get("sub_menu", ""))
        for num, el in enumerate(menu):
            print("%s. %s" % (num, el["text"]))
        choice = int(input(": "))
        if menu[choice].get("do"):
            if menu[choice]["do"]():
                break
        else:
            menu_do(menu[choice]["sub_menu"], sub_menu=menu[choice]["text"])
예제 #19
0
파일: menu.py 프로젝트: Azimusss/Azis
def menu_do(menu, **kwargs):
    while True:
        clear()
        print("*" * 24)
        print("* Welcome to %s %s *" % (school_data['number'], school_data['type']))
        print("*" * 24)
        print("MENU > ", kwargs.get("sub_menu", ''))
        for num, el in enumerate(menu):
            print("%s. %s" % (num, el["text"]))
        choice = int(input(": "))
        if menu[choice].get("do"):
            if menu[choice]["do"]():
                break
        else:
            menu_do(menu[choice]["sub_menu"], sub_menu=menu[choice]['text'])
예제 #20
0
def login():
    utilities.clear()
    print("""

    Login to your account!

    """)
    name = input('Enter username')
    password = input('Enter password \n')

    if name and password:
        general_DB.verify_credentials(
            username=name, password=password, entity='student')
    else:
        print("please enter username and password")
예제 #21
0
def execute_drop(item_id):
    """This function takes an item_id as an argument and moves this item from the
    player's inventory to list of items in the current room. However, if there is
    no such item in the inventory, this function prints "You cannot drop that."
    """
    found = False
    for item in player.inventory:
        if item['id'] == item_id:
            player.inventory.remove(item)
            player.current_room['items'].append(item)
            found = True

    if not found:
        clear()
        print("You dont have that!")
        time.sleep(1)
예제 #22
0
파일: run.py 프로젝트: Phoenix476/School
def teachers():
    global teachers_data
    global school_data
    clear()
    print("*" * 24)
    print("* Welcome to %s %s *" % (school_data['number'], school_data['type']))
    print("*" * 24)
    print("     MENU > Информация > Об учителях")
    # TODO(complete): дописать вывод по аналогии с учениками
    for class_room in school_data["classes"]:
        print("Учителя '%s' класса: " % class_room)
        for num, teacher in enumerate(search(teachers_data, class_room=class_room)):
            print("     ", '%s)' % (num + 1), get_full_name(teacher))
            print("-" * 24)
    input("Нажмите Enter для возврата в предыдущее меню")
    return
예제 #23
0
def login():
    utilities.clear()
    print(f"""
    
    Welcome admin enter username and password 

    """)
    name = input('Enter username \n')
    password = input('Enter password \n')

    if name and password:
        general_DB.verify_credentials(username=name,
                                      password=password,
                                      entity='admin')
    else:
        print("Please enter username and password")
        login()
예제 #24
0
파일: run.py 프로젝트: Phoenix476/School
def students():
    global students_data
    global school_data
    clear()
    print("*" * 24)
    print("* Welcome to %s %s *" % (school_data['number'], school_data['type']))
    print("*" * 24)
    print("     MENU > Информация > Об учениках")
    for class_room in school_data["classes"]:
        print("Ученики '%s' класса: " % class_room)
        for num, student in enumerate(search(students_data, class_room=class_room)):
            # FIXME(complete): учесть(во всей программе), в файле могут быть ученики из других школ
            # TODO(complete): Добавить нумерацию учеников для каждого класса
            print("     ", '%s)' % (num + 1), get_full_name(student))
            print("-" * 24)
    input("Нажмите Enter для возврата в предыдущее меню")
    return
예제 #25
0
def main():

    util.clear()

    # select and set target system and cost log
    system_name, result_path = util.GetTargetDir(main_result_path,
                                                 "target system")
    print("Result directory is: " + result_path)

    print('cost dataset prepration...')
    # Initialization of cost dataset preparation module
    ObjDatasetPreparation = DatasetPreparation(result_path)

    # load cost monitoring settings
    ObjDatasetPreparation.LoadExprimentSetting()

    # load extracted ROIs power measurements for the NILM algorithm
    ObjDatasetPreparation.LoadExtractedROIMeterData()

    # estimation of processing time and energy costs
    ObjDatasetPreparation.PreprocessExtractedROIMeterData()

    # load processing time cost estimation from in code measurement from system logs
    ObjDatasetPreparation.LoadSystemLogData()

    # prepare cost datasets from meter and system logs
    ObjDatasetPreparation.PrepareCostDataset()

    # store cost dataset for later use
    ObjDatasetPreparation.SaveCostDataset()

    print('cost dataset illustrations....')
    # Initialization of data analysis
    ObjDataAnalysis = DataAnalysis(ObjDatasetPreparation.result_path)

    # load cost dataset
    df_cost, df_cost_agg = ObjDataAnalysis.LoadCostDataset()

    # illustrate the cost dataset in data analysis plots
    ObjDataAnalysis.PlotAnalysis(df_cost, df_cost_agg, result_path)

    msg = "{}\n The resulting cost datasets can be found in {}/ and \n some illustrations are placed in {}/.\n{}"\
            .format("*"*60, setting_dict["meter_log"]["log_dir"], setting_dict["meter_log"]["figure_dir"], "*"*60)
    print(msg)

    print('Done!')
예제 #26
0
def draw_anim_ascii(path):

    a_file = open(path, 'r')
    line_len_list = []
    for line in a_file:
        line_len_list.append(len(line))

    max_len = max(line_len_list)
    for i in range(0, max_len):
        clear()

        ascii_file = open(path, 'r')
        for line in ascii_file:
            new_line = line[:-1]
            print(new_line[0:i])

        sleep(0.005)
예제 #27
0
def main():
    bingo = Bingo()
    stack = Stack()
    for num in range(1,91):
        bingo.push(num)
    
    clear()
    print(bingo.getContainer(), "\n")

    for i in range(5):
        stack.pushBoard(Carton(i, bingo.getSizeBoard()))

    print("Cartones:\n")
    for obj in stack.getBoards():
        print(obj.getNumbers(),"\n")
    

    input("\nPresione cualquier tecla para continuar...")
예제 #28
0
def menu_do(menu, **kwargs):
    while True:
        clear()
        print("*" * 24)
        print("* Welcome to %s %s *" % (school_data['number'], school_data['type']))
        print("*" * 24)
        print("MENU > ", kwargs.get("sub_menu", ''))
        for number, el in enumerate(menu, start=1):
            print("%s. %s" % (number, el["text"]))
        choice = int(input(": "))
        if menu[choice-1].get("do"):
            menu[choice-1]["do"]()
            break
        elif menu[choice-1].get("sub_menu"):
            menu_do(menu[choice-1]["sub_menu"], sub_menu=menu[choice-1]['text'])
            # return True
        else:
            raise KeyError ('Вы ввели не существующий ключ')
예제 #29
0
def main():

    util.clear()
    
    print('house load data cleaning...')

    # initialization of data cleaner
    ObjDataCleaner = DataCleaner(datatimestamp_splitsize = 1) 

    # display house load data setting info
    ObjDataCleaner.DisplayInfo()

    # clean and prepared the baseline daily cleaned load data ref dataset and save it for later uses in large-scale laod generation
    ObjDataCleaner.GenerateCleanedDataDbRef()

    # load the generated cleaned load dataset
    cleaneddata_db_ref = ObjDataCleaner.LoadCleanedDataDbRef()
    
    # display house load dataset info
    ObjDataCleaner.DisplayInfo()
예제 #30
0
 def clear(self):
     self.m1.hide()
     self.m2.hide()
     self.m3.hide()
     self.m4.hide()
     self.m5.hide()
     self.m6.hide()
     clear()
     self.m1.setPixmap(QPixmap('estimated_layout.png'))
     self.m2.setPixmap(QPixmap('real_layout.png'))
     self.m3.setPixmap(QPixmap('estimated_layout.png'))
     self.m4.setPixmap(QPixmap('real_layout.png'))
     self.m5.setPixmap(QPixmap('estimated_layout.png'))
     self.m6.setPixmap(QPixmap('real_layout.png'))
     self.m1.show()
     self.m2.show()
     self.m3.show()
     self.m4.show()
     self.m5.show()
     self.m6.show()
     QApplication.processEvents()
예제 #31
0
def main():

    player_won = False

    # Main game loop
    while not player_won:
        # Display game status (room description, inventory etc.)
        print_room(player.current_room)
        print_inventory_items(player.inventory)

        # Show the menu with possible actions and ask the player
        command = menu(player.current_room["exits"], player.current_room["items"], player.inventory)

        # Execute the player's command
        execute_command(command)

        if len(rooms['Reception']['items']) == 6:
            player_won = True

    clear()
    print('YOU WIN!')
    time.sleep(3)
예제 #32
0
    def main_menu(self):
        #Display
        clear()
        draw_anim_ascii('welcome.txt')
        print('\n \n \n \n')
        #print(self.title.upper() + '\n')
        print('                     Select:\n\n                      a.New Game\n                      b.Load Game\n                      c.Exit\n\n')

        #Take input
        inp = input('->')
        if inp == 'a':
            new_player = Player()
            self.new_game_menu(new_player)

        elif inp == 'b':
            pass
        elif inp == 'c':
            quit()
        else:
            clear()
            print('Enter a valid option')
            time.sleep(1)
예제 #33
0
def main():

    util.clear()

    # selecting target cost dataset working directory
    system_name, data_path = util.GetTargetDir(main_result_path, "server name")
    print("Target directory is: " + data_path)

    # initialize cost analysis module
    ObjAnalyzer = CostAnalyzer(data_path=data_path, system_name=system_name)

    # load working cost dataset
    ObjAnalyzer.LoadWorkingDataset()

    # plots associated costs, correlations and comparisons
    ObjAnalyzer.FeatureAnalysis(issave=True, isfigshow=False)

    # generate predicted energy costs on daily, monthly and yearly bases with breakdown for the NILM algorithm and static power costs
    # ObjAnalyzer.PredictionSystem()

    # generate summary table of cost analysis of the NILM algorithm
    df_cost_analysis = ObjAnalyzer.CapacityAnalysis()
    print(df_cost_analysis)
예제 #34
0
def createStudent():
    utilities.clear()
    print('creating student')
    firstName = input('Enter students first Name \n')
    lastName = input('Enter students last Name \n')
    gender = input('Enter Gender\n')
    dateOfBirth = input('Enter date of birth\n')
    dateOfEnrollment = input('Enter date of enrollment\n')

    newStudentData = {
        'firstName': firstName,
        'lastName': lastName,
        'dOB': dateOfBirth,
        'gender': gender,
        'dOE': dateOfEnrollment
    }

    studentObject = student_logic.Student(**newStudentData)

    print(f"""
                    Verify student Data

        First Name    = {studentObject.getFirstName()}
        Last Name     = {studentObject.getLastName()}
        Gender        = {studentObject.getGender()}
        Date of Birth = {studentObject.getDateOfBirth()}

    """)

    newStudentData['username'] = studentObject.username
    newStudentData['password'] = studentObject.password

    response = input("yes to enter student to DB \n")
    if response.upper() == 'YES':
        student_DB.addStudent(**newStudentData)
        admin_home.admin_home({'name': 'admin'})
예제 #35
0
def launch_cli():

    utils.config_logger("messages.log")
    show_welcome()
    network_data, entities_threads, client_ids = init()
    signal.signal(signal.SIGINT, cmd.MyHandler(entities_threads))

    try:
        while True:
            show_network_status(network_data, entities_threads)
            show_prompt(command_ids)
            command_id = utils.retrieve_id(utils.is_in_list, command_ids,
                                           command_ids)

            utils.clear()
            utils.print_separator()

            launch_command(command_ids[command_id], network_data,
                           entities_threads, client_ids)

            utils.clear()

    except KeyboardInterrupt:
        pass
예제 #36
0
def homePage():
    while True:
        utilities.clear()
        print("""

        (```````````````````````````````````````````````````````````)
        (              BLaBla UNIVESITY PORTAL                      )
        (               how do u wanna login as?                    )
        (                                                           )
        (         1.  Student                                       )
        (         2.  Teacher                                       )
        (         3.  Admin                                         )
        (         000.Reset password                                )
        (_________0.  exit__________________________________________)

        """)

        choice = int(input('Please make a choice. \n'))

        if choice == 1:
            student_login.login()
        elif choice == 2:
            teacher_login.login()
        elif choice == 3:
            admin_login.login()
        elif choice == 000:
            # reset password link
            utilities.clear()
            print("""
            What are you?
            1. Student
            2. Teacher
            3. Admin
            4. Robot
            """)
            selection = int(input('what are you? \n'))
            if selection == 1:
                selection = 'student'
            elif selection == 2:
                selection = 'teacher'
            elif selection == 3:
                selection = 'admin'
            else:
                print('idkkkkk and idc')
                continue
            username = input('Enter your username \n')
            general_DB.changePassword(username, selection)
        elif choice == 0:
            utilities.clear()
            print("exiting...")
            break
        else:
            print('Error please enter choice again!')
예제 #37
0
def show_welcome():
    data.load_text("../resources/ascii.txt")
    input("Press any key to initialize the network" + "\n> ")
    utils.clear()
예제 #38
0
    grafo = Grafo()

    grafo.agregar_nodo("Ca")
    grafo.agregar_nodo("Bo")
    grafo.agregar_nodo("Ct")
    grafo.agregar_nodo("Ba")
    grafo.agregar_nodo("Pe")
    grafo.agregar_nodo("Sa")
    grafo.agregar_nodo("Rn")
    grafo.agregar_nodo("Cu")

    grafo.conectar_nodos("Ca", "Bo", 320)
    grafo.conectar_nodos("Ca", "Pe", 295)
    grafo.conectar_nodos("Ca", "Ct", 2035)
    grafo.conectar_nodos("Ca", "Sa", 1170)
    grafo.conectar_nodos("Bo", "Rn", 500)
    grafo.conectar_nodos("Bo", "Ba", 905)
    grafo.conectar_nodos("Bo", "Cu", 550)
    grafo.conectar_nodos("Ct", "Ba", 415)
    grafo.conectar_nodos("Ba", "Sa", 770)

    return grafo


if __name__ == "__main__":
    clear()
    grafo = test1()
    print(grafo)
    # grafo.graficar()
    dijkstra.solucionar(grafo.nodos[0], grafo)
예제 #39
0
                        dest='reset',
                        nargs='+',
                        choices=['features', 'classifier', 'full'],
                        default=[])
    # parser.add_argument('-train', dest='train',
    # 	action='store_const', const=manager.train, default=nothing)
    parser.add_argument('-predict',
                        dest='predict',
                        action='store_const',
                        const=manager.predict,
                        default=nothing)
    parser.add_argument('-eval',
                        dest='evaluate',
                        action='store_const',
                        const=manager.evaluate,
                        default=nothing)
    parser.add_argument('-corpus_dir', default=DEV_DIR)
    parser.add_argument('-train_dir', default=TRAIN_DIR)
    parser.add_argument('-test_dir', default=TEST_DIR)
    parser.add_argument('-save_dir', default=SAVE_DIR)

    args = parser.parse_args()
    if 'full' in args.reset:
        utilities.clear()
    manager.set_dir(args.corpus_dir, args.train_dir, args.test_dir,
                    args.save_dir)
    manager.train('features' in args.reset, 'classifier' in args.reset)
    pred = args.predict()
    if pred is not None: print(pred)
    args.evaluate()
예제 #40
0
 def show_room(self, room):
     clear()
     print('\n' + room.name.upper() + '\n')
     print(room.description + '\n')
예제 #41
0
파일: run.py 프로젝트: kotland/school
    with open(location("data_tasks_6/school.json")) as school_data:
        school_data = json.load(open(location("data_tasks_6/school.json")))

    with open(location("data_tasks_6/Students.json")) as students_data:
        students_data = json.load(open(location("data_tasks_6/Students.json")))

    with open(location("data_tasks_6/Teachers.json")) as teachers_data:
        teachers_data = json.load(open(location("data_tasks_6/Teachers.json")))


# Load data
load_data()

# MAIN

clear()
# Про цветной текст ищите в гугле
print("\033[1;34m*\033[1;m" * 24)
print("\033[1;34m* Welcome to %s %s *\033[1;m" % (school_data["number"], school_data["type"]))
print("\033[1;34m*\033[1;m" * 24)
print("     MENU")
print("1. Информация")
print("2. Редактировать")
print("3. Выйти")
choice = input(":")

if choice == "1":  # INFO
    clear()
    print("*" * 24)
    print("* Welcome to %s %s *" % (school_data["number"], school_data["type"]))
    print("*" * 24)
예제 #42
0
    for expId in util.tqdm(expIds, ncols=100):
        # print('plotting expId: ', expId)
        df_exprmnt = df_wupower_extracted[(df_wupower_extracted.expId==expId)]
        Nhs = list(df_exprmnt.Nh.unique())
        
        for Nh in Nhs:
            # print('plotting Nhs: ', Nh)
            df = df_exprmnt[(df_exprmnt.Nh==Nh)]
            ObjSeqPattern.PlotSelections(df, 'Np', figure_path = figure_path, figname = "expId_{}_NhId_{}_rec".format(expId, Nh))
       
    print('Done!')

# %%
if __name__ == '__main__': 

    util.clear()

    # selecting target system for monitored logs working directory
    system_name, result_path = util.GetTargetDir(result_path, "target system")
 
    print("Result directory is: " + result_path)
    
    # select cost log directory
    result_folder, result_path = util.GetTargetDir(result_path, "target log folder")
    print("Result directory is: " + result_path)

    # clean and plot extracted ROIs hierarchically and recursively
    main(result_path)

    msg = "{}\n The illustration of the cleaned ROIs at different levels are placed in {}/.\n{}"\
            .format("*"*60, setting_dict["meter_log"]["figure_dir"], "*"*60)