# 返回正确验证码图片的位置
def get_answer():
xy_pos = input('请输入验证码正确的图形位置:')
xy_position = []
if xy_pos.isdigit():
for i in xy_pos:
i = int(i) - 1
if 0 <= i <= 3:
x, y = i, 0
else:
x, y = i - 4, 1
x_position, y_position = 38 + (67 + 5) * x, 41 + (67 + 5) * y
xy_position.append('{},{}'.format(x_position, y_position))
return ','.join(xy_position)
if __name__ == '__main__':
get_answer()
code.jpg
网友评论