コード例 #1
0
def main():
    """
    Main function for the CLI parsing.
    """

    cli_parser.parse_options()

#    print(cli_parser.options)
#    print(cli_parser.options["known_args"])

#    print()

    sys.exit()
コード例 #2
0
def main():
    """
    Main function where it all starts.
    """

    cli_parser.parse_options()

    print(cli_parser.options)

    print(cli_parser.options["known_args"]["command"])

    print()

    sys.exit()
コード例 #3
0
ファイル: main.py プロジェクト: dbwebb-se/python
def main():
    """
    Main function where it all starts.
    """
    
    cli_parser.parse_options()
    
    print(cli_parser.options)
    
    print(cli_parser.options["known_args"]["command"])
    
    print()

    sys.exit()
コード例 #4
0
ファイル: main.py プロジェクト: starke333/python
def main():
    """
    Main function where it all starts.
    """

    options = cli_parser.parse_options()
    command = options["args"]["command"]
    silent = options["args"]["silent"]
    verbose = options["args"]["verbose"]

    if command == "hello":
        if silent:
            print("Hi!")
        elif verbose:
            print(verbose_text.format(input=command, unknown=options["unknown_args"]))
        else:
            print("This is a response to the command: " + command + ":\nHello there!")

    if command == "goodbye":
        if silent:
            print("Bye!")
        elif verbose:
            print(verbose_text.format(input=command, unknown=options["unknown_args"]))
        else:
            print("This is a response to the command: " + command + ":\nGoodbye!")

    sys.exit()
コード例 #5
0
def main():
    """
    Main function where it all starts.
    """

    options = cli_parser.parse_options()

    print(options)

    if options["args"]["first"]:
        print("Your input was: ", options["args"]["first"])

    sys.exit()
コード例 #6
0
ファイル: main.py プロジェクト: dbwebb-se/python
def main():
    """
    Main function where it all starts.
    """

    options = cli_parser.parse_options()

    print(options)

    if options["args"]["first"]:
        print("Your input was: ", options["args"]["first"])

    sys.exit()
コード例 #7
0
ファイル: adventure.py プロジェクト: Graudusk/adventure-game
def main():
    """
    The main func that starts the program
    """
    opts = cli_parser.parse_options()

    args = opts["known_args"]

    if args["info"] is True:
        print_info_cli()
    elif args["cheat"] is True:
        print_cheat()
    elif args["about"] is True:
        print_about()
    else:
        start_game()
コード例 #8
0
ファイル: main.py プロジェクト: starke333/python
def main():
    """
    Main function where it all starts.
    """

    options = cli_parser.parse_options()
    command = options["args"]
    silent = options["args"]["silent"]
    verbose = options["args"]["verbose"]

    if command["first"]:
        if silent:
            print(command["first"])
        elif verbose:
            print(verbose_text.format(input=command["first"], unknown=options["unknown_args"]))
        else:
            print("Your input was:", command["first"])

    sys.exit()
コード例 #9
0
            interaction = splited[0]
            item = splited[1]

            rooms = game.to_open(rooms, current_room, interaction, item)

        else:
            game.notValid()
        # Detta gick inte igenom valideringen....... :(
        # elif "open" in choice or "k" in choice or "kick" in choice\
        #     or "l" in choice or "look" in choice or "o" in choice\
        #     or "open" in choice or "m" in choice or "move" in choice:
        #     # sends room dictionary, current room splited string into open function
        #     splited = choice.split()
        #     interaction = splited[0]
        #     item = splited[1]
        #
        #     rooms = game.to_open(rooms, current_room, interaction, item)
        #
        # else:
        #     game.notValid()

    sys.exit()
#    input("\nPress enter to continue...")

if __name__ == "__main__":
    cli_parser.parse_options()
    #print(cli_parser.parse_options())
    #print(cli_parser.options["known_args"]["command"])

    main()