def fetch_span(width_span, height_span, step=100):
width_diff = sub(*reversed(width_span))
step_count = width_diff // step
if step_count <= 1:
width = min(*width_span)
else:
width = width_span[0] + randint(0, step_count) * step
height_diff = sub(*reversed(height_span))
step_count = height_diff // step
if step_count <= 1:
height = min(*height_span)
else:
height = height_span[0] + randint(0, step_count) * step
return width, height
评论列表
文章目录