Spaces:
Running
Running
Commit
·
ad176ff
1
Parent(s):
e269a06
fix folders
Browse files- __pycache__/solver.cpython-310.pyc +0 -0
- output/Tablero_solucion.png +0 -0
- solver.py +21 -0
- wordsPuzzle/ALDRIN.jpg +0 -0
- wordsPuzzle/BARNEY.jpg +0 -0
- wordsPuzzle/LAWYER.jpg +0 -0
- wordsPuzzle/LILY.jpg +0 -0
- wordsPuzzle/MANHATTAN.jpg +0 -0
- wordsPuzzle/MARSHALL.jpg +0 -0
- wordsPuzzle/MOSBY.jpg +0 -0
- wordsPuzzle/PRESENTER.jpg +0 -0
- wordsPuzzle/SCHERBATSKY.jpg +0 -0
- wordsPuzzle/TEACHER.jpg +0 -0
- wordsPuzzle/TED.jpg +0 -0
__pycache__/solver.cpython-310.pyc
CHANGED
Binary files a/__pycache__/solver.cpython-310.pyc and b/__pycache__/solver.cpython-310.pyc differ
|
|
output/Tablero_solucion.png
CHANGED
![]() |
![]() |
solver.py
CHANGED
@@ -106,6 +106,27 @@ def read_board(img, words):
|
|
106 |
|
107 |
|
108 |
def solve_puzzle(img, words):
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
109 |
# print(type(img))
|
110 |
# str to filepath
|
111 |
#print(type(words))
|
|
|
106 |
|
107 |
|
108 |
def solve_puzzle(img, words):
|
109 |
+
# Borrar el directorio de imagenes
|
110 |
+
folder = 'output'
|
111 |
+
for filename in os.listdir(folder):
|
112 |
+
file_path = os.path.join(folder, filename)
|
113 |
+
try:
|
114 |
+
if os.path.isfile(file_path) or os.path.islink(file_path):
|
115 |
+
os.unlink(file_path)
|
116 |
+
elif os.path.isdir(file_path):
|
117 |
+
shutil.rmtree(file_path)
|
118 |
+
except Exception as e:
|
119 |
+
print('Failed to delete %s. Reason: %s' % (file_path, e))
|
120 |
+
folder = 'wordsPuzzle'
|
121 |
+
for filename in os.listdir(folder):
|
122 |
+
file_path = os.path.join(folder, filename)
|
123 |
+
try:
|
124 |
+
if os.path.isfile(file_path) or os.path.islink(file_path):
|
125 |
+
os.unlink(file_path)
|
126 |
+
elif os.path.isdir(file_path):
|
127 |
+
shutil.rmtree(file_path)
|
128 |
+
except Exception as e:
|
129 |
+
print('Failed to delete %s. Reason: %s' % (file_path, e))
|
130 |
# print(type(img))
|
131 |
# str to filepath
|
132 |
#print(type(words))
|
wordsPuzzle/ALDRIN.jpg
CHANGED
![]() |
![]() |
wordsPuzzle/BARNEY.jpg
CHANGED
![]() |
![]() |
wordsPuzzle/LAWYER.jpg
CHANGED
![]() |
![]() |
wordsPuzzle/LILY.jpg
CHANGED
![]() |
![]() |
wordsPuzzle/MANHATTAN.jpg
CHANGED
![]() |
![]() |
wordsPuzzle/MARSHALL.jpg
CHANGED
![]() |
![]() |
wordsPuzzle/MOSBY.jpg
CHANGED
![]() |
![]() |
wordsPuzzle/PRESENTER.jpg
CHANGED
![]() |
![]() |
wordsPuzzle/SCHERBATSKY.jpg
CHANGED
![]() |
![]() |
wordsPuzzle/TEACHER.jpg
CHANGED
![]() |
![]() |
wordsPuzzle/TED.jpg
CHANGED
![]() |
![]() |