def move(x,y): bot=AutoKiddobot() bot.start() for i, (ix, iy) in enumerate(zip(x,y)): l=len(x) if(i+1==l): break dx=x[i]-x[i+1] dy=y[i]-y[i+1] if(abs(dx and dy)>8): bot.pen_up() time.sleep(1) bot.pen_down() bot.go_to_xy(x[i+1],y[i+1]) else: bot.pen_down() bot.go_to_xy(ix,iy)
def write(): global y_pred bot=AutoKiddobot() bot.start() fn='Coordinate\\'+y_pred+'.txt' with open (fn) as file: line=file.readlines() data=cvrtarr(line) x,y=xycvrt(data) bot.go_to_xy(x[0],y[0]) time.sleep(1) move(x,y) bot.pen_up() bot.go_to_xy(0,0) time.sleep(2) bot.close()
def write(): global path bot = AutoKiddobot() bot.start() x, y = xycvrt(path) bot.go_to_xy(y[0], x[0]) time.sleep(1) move(x, y) bot.pen_up() bot.go_to_xy(0, 0) time.sleep(2) bot.close()