Esempio n. 1
0
        offset_len = len(splited[0]) + 1

        print("*" * 40)
        print(f"The pattern match the stored string!")
        print(f"The offset position is: {offset_len}!")
        print("*" * 40)
        FileManager.delete_file()
    else:
        print("The pattern does not match!")


if __name__ == "__main__":
    try:
        parser = argparse.ArgumentParser()
        parser.add_argument("--auto", help="automate search. Usage: --auto 1")
        args = parser.parse_args()
        
        if args.auto:
            user_input = input("Please type either a string or a string length: \n")        
            automate_search_pattern(user_input)
        else:
            if not FileManager.file_exists():
                set_random_alphanumeric()
            else:
                check_pattern()

    except KeyboardInterrupt:
        print('Interrupted')
        if FileManager.file_exists():
            FileManager.delete_file()