Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit e9f7e42

Browse filesBrowse files
try 24
1 parent dcbcb3c commit e9f7e42
Copy full SHA for e9f7e42

File tree

3 files changed

+47
-51
lines changed
Filter options

3 files changed

+47
-51
lines changed

‎24-1.py

Copy file name to clipboardExpand all lines: 24-1.py
+35-40Lines changed: 35 additions & 40 deletions
Large diffs are not rendered by default.

‎24.py

Copy file name to clipboardExpand all lines: 24.py
+11-11Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -10,19 +10,23 @@ def __init__(self, pasts):
1010

1111
def main():
1212
file_path = "maze/maze.png"
13-
log_file_path = "maze/log/result.txt"
14-
handler = logging.handlers.RotatingFileHandler(log_file_path, maxBytes=1024 * 1024, backupCount= 10000)
13+
logger = set_logger()
14+
points_pixels, width, height = first_step(file_path)
15+
# second_step(points_pixels, height)
16+
start = (639, 0)
17+
# third_step(start, points_pixels, logger)
18+
19+
20+
def set_logger():
21+
log_file_path = "maze/log/mylog.log"
22+
handler = logging.handlers.RotatingFileHandler(log_file_path, maxBytes=1024 * 1024, backupCount=10000)
1523
fmt = "%(asctime)s=>%(message)s"
1624
formatter = logging.Formatter(fmt)
1725
handler.setFormatter(formatter)
1826
logger = logging.getLogger("maze/log/mylog")
1927
logger.addHandler(handler)
2028
logger.setLevel(logging.DEBUG)
21-
22-
points_pixels, width, height = first_step(file_path)
23-
# second_step(points_pixels, height)
24-
start = (639, 0)
25-
third_step(start, points_pixels, logger)
29+
return logger
2630

2731

2832
def first_step(file_path):
@@ -114,16 +118,12 @@ def find_next_point(points_pixels, x, y, past, logger):
114118
up_point = x, up_y
115119
down_point = x, down_y
116120
if right_x_pixel is not None and right_x_pixel != (255, 255, 255, 255):
117-
# logger.info("right_x={}, y={}, right_x_pixel={}".format(right_x, y, right_x_pixel))
118121
points.append(right_point)
119122
if left_x_pixel is not None and left_x_pixel != (255, 255, 255, 255):
120-
# logger.info("left_x={}, y={}, left_x_pixel={}".format(left_x, y, left_x_pixel))
121123
points.append(left_point)
122124
if up_y_pixel is not None and up_y_pixel != (255, 255, 255, 255):
123-
# logger.info("x={}, up_y={}, up_y_pixel={}".format(x, up_y, up_y_pixel))
124125
points.append(up_point)
125126
if down_y_pixel is not None and down_y_pixel != (255, 255, 255, 255):
126-
# logger.info("x={}, down_y={}, down_y_pixel={}".format(x, down_y, down_y_pixel))
127127
points.append(down_point)
128128
for point in points:
129129
now_index = past.index((x, y))

‎maze/constant.py

Copy file name to clipboardExpand all lines: maze/constant.py
+1Lines changed: 1 addition & 0 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.