Post
Topic
Board Bitcoin Discussion
Re: Bitcoin puzzle transaction ~32 BTC prize to who solves it
by
Denis_Hitov
on 11/09/2023, 12:57:43 UTC
Code:
import re

# List of target public keys
target_public_keys = ['0370e7c3d922008d9ccea410d560cd440a834a811a1ea74c2967637ca015a788a3']  # as a list

# Regular expression pattern for matching public keys
pattern = r"\b(" + "|".join(target_public_keys) + r")\b"

# Output file to log matches
output_file = "matches.txt"

# List of files to search through
files_to_search = ["Finish-him-Jack-wins.tx"]

# Open the output file for writing
with open(output_file, "[b]a[/b]") as output:

    for filename in files_to_search:
        with open(filename, "r") as file:
            content = file.read()
            matches = re.findall(pattern, content)
            if matches:
                output.write(f"Matches found in {filename}:\n")
                for match in matches:
                    output.write(match + "\n")
                output.write("\n")

print("Search completed. Matching public keys saved in", output_file)


 with open(output_file, "a") as output:
ValueError: invalid mode: 'a'