Example #1
0
def main_menu():

    #Clear Screen
    os.system('cls')

    #Menu Options
    questions = [{
        'type':
        'list',
        'name':
        'menu',
        'message':
        'Please make a choice from the list below',
        'choices': ['First Time User', 'Track Workout Data', 'Workout Goal']
    }]

    #Font type of title
    f = Figlet(font='slant')
    print(f.renderText('Workout Tracker'))

    #Print out Questions menu
    answers = prompt(questions, style=custom_style_2)

    #Process Menu Choice
    if answers['menu'] == 'First Time User':
        newUser()
    if answers['menu'] == 'Track Workout Data':
        workoutData()
    if answers['menu'] == 'Workout Goal':
        workoutGoals()

    print_json(answers)
Example #2
0
        'name': 'overwrite',
        'default': 'a',
        'choices': [
            {
                'key': 'y',
                'name': 'Overwrite',
                'value': 'overwrite'
            },
            {
                'key': 'a',
                'name': 'Overwrite this one and all next',
                'value': 'overwrite_all'
            },
            {
                'key': 'd',
                'name': 'Show diff',
                'value': 'diff'
            },
            Separator(),
            {
                'key': 'x',
                'name': 'Abort',
                'value': 'abort'
            }
        ]
    }
]

answers = prompt(questions, style=custom_style_2)
print_json(answers)