Game.py 文件源码

python
阅读 32 收藏 0 点赞 0 评论 0

项目:spartacus 作者: CommunicationsSecurityEstablishment 项目源码 文件源码
def parseCommandLineArgs():
    """
    This simply parses the command line so we can get both players file information
    :return: A parsed object as provided by argparse.parse_args()
    """
    parser = argparse.ArgumentParser(prog="Game.py",
                                     description="Capua Assembler Version {}".format(__version__,),
                                     epilog="This tool is provided as part of Spartacus learning environment under {} "
                                            "licence. Feel free to distribute, modify, "
                                            "contribute and learn!".format(__license__,))
    parser.add_argument("-1", "--p1",
                        required=True,
                        nargs=1,
                        type=str,
                        help="Define the player 1 binary file to be loaded")

    parser.add_argument("-2", "--p2",
                        required=True,
                        nargs=1,
                        type=str,
                        help="Define the player 2 binary file to be loaded")

    args = parser.parse_args()
    args.p1 = os.path.abspath(args.p1[0])  # This originally come out as a list
    args.p2 = os.path.abspath(args.p2[0])

    return args
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号