def getNearestPointInPerimeter(self, left, top, width, height, x, y):
right = left + width
bottom = top + height
clamp = lambda value, minv, maxv: max(min(value, maxv), minv)
x = clamp(x, left, right)
y = clamp(y, top, bottom)
dl = abs(x - left)
dr = abs(x - right)
dt = abs(y - top)
db = abs(y - bottom)
m = min(dl, dr, dt, db)
if m == dt:
result = (x, top)
elif m == db:
result = (x, bottom)
elif m == dl:
result = (left, y)
else:
result = (right, y)
return result
我可以对它进行小计,但我希望它在自己的专栏中。我已尝试分段执行此操作,但由于整个工作表超过168K行,因此需要很长时间。有人可以帮我一把吗?
答案 0 :(得分:0)
这对你有用吗?放在while True:
try:
if '?' in tokens.text:
toks.remove('?')
except:
try:
if ',' in tokens.text:
toks.remove(',')
except:
try:
if 'you' in tokens.text:
toks.remove('you')
except:
break
并向下拖动
C2