Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

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

Sign up
Appearance settings

Commite9f7e42

Browse files
try 24
1 parentdcbcb3c commite9f7e42

File tree

3 files changed

+47
-51
lines changed

3 files changed

+47
-51
lines changed

‎24-1.py

Lines changed: 35 additions & 40 deletions
Large diffs are not rendered by default.

‎24.py

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -10,19 +10,23 @@ def __init__(self, pasts):
1010

1111
defmain():
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+
defset_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+
returnlogger
2630

2731

2832
deffirst_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
ifright_x_pixelisnotNoneandright_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
ifleft_x_pixelisnotNoneandleft_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
ifup_y_pixelisnotNoneandup_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
ifdown_y_pixelisnotNoneanddown_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
forpointinpoints:
129129
now_index=past.index((x,y))

‎maze/constant.py

Lines changed: 1 addition & 0 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp