fixed format
This commit is contained in:
7
solve.py
7
solve.py
@@ -1,4 +1,3 @@
|
||||
from logging import disable
|
||||
from PIL import Image
|
||||
from pyzbar.pyzbar import decode
|
||||
import itertools
|
||||
@@ -104,7 +103,7 @@ def solve_combo(combo):
|
||||
return None
|
||||
|
||||
|
||||
def main(img_path="student_fair/secret_message.png", verbose=True):
|
||||
def main(img_path="files/secret_message.png", verbose=True):
|
||||
img = Image.open(img_path)
|
||||
global new_image
|
||||
new_image = Image.new("RGB", (img.height, img.height))
|
||||
@@ -129,10 +128,8 @@ def main(img_path="student_fair/secret_message.png", verbose=True):
|
||||
|
||||
result = None
|
||||
|
||||
MAX_WORKER = 6
|
||||
|
||||
# Use `multiprocessing.Pool` with the number of available cores
|
||||
with Pool(MAX_WORKER) as pool:
|
||||
with Pool() as pool:
|
||||
# `imap_unordered` returns results as they are completed.
|
||||
# This is a lazy iterator, so it doesn't create all combos at once.
|
||||
# `tqdm` can still be used to show progress.
|
||||
|
||||
Reference in New Issue
Block a user