shenzhen-solitaire.py
def main():
    """Parse command line arguments and execute."""
    parser = argparse.ArgumentParser()

    # Commands
    parser.add_argument('-i', '--save-imgs',
                        help="saves screenshot snippets to CARD_DIR for "
                        "identification",
                        action='store_true')

    # Options
    parser.add_argument('-s', '--silent',
                        help="don't print out progress messages",
                        action='store_true')

    args = parser.parse_args()

    global VERBOSE # pylint: disable=W0603
    VERBOSE = not args.silent

    if args.save_imgs:
        save_card_imgs()
    else:
        # Solve games in a loop
        while True:
            click_window()
            click_newgame()
            time.sleep(6)
            autosolve_game(timeout=120)
            time.sleep(4)
Parse command line arguments and execute.
Parse command line arguments and execute.
Parse command line arguments and execute .
def main():
    parser = argparse.ArgumentParser()
    parser.add_argument('-i', '--save-imgs',
                        help="saves screenshot snippets to CARD_DIR for "
                        "identification",
                        action='store_true')
    parser.add_argument('-s', '--silent',
                        help="don't print out progress messages",
                        action='store_true')
    args = parser.parse_args()
    global VERBOSE 
    VERBOSE = not args.silent
    if args.save_imgs:
        save_card_imgs()
    else:
        while True:
            click_window()
            click_newgame()
            time.sleep(6)
            autosolve_game(timeout=120)
            time.sleep(4)
def main ( ) : parser = argparse . ArgumentParser ( ) parser . add_argument ( '-i' , '--save-imgs' , help = "saves screenshot snippets to CARD_DIR for " "identification" , action = 'store_true' ) parser . add_argument ( '-s' , '--silent' , help = "don't print out progress messages" , action = 'store_true' ) args = parser . parse_args ( ) global VERBOSE VERBOSE = not args . silent if args . save_imgs : save_card_imgs ( ) else : while True : click_window ( ) click_newgame ( ) time . sleep ( 6 ) autosolve_game ( timeout = 120 ) time . sleep ( 4 )
Parse command line arguments and execute.
Parse command line arguments and execute .
"""Parse command line arguments and execute.""" # Commands # Options # pylint: disable=W0603 # Solve games in a loop