def tweak(dev, step): import ch.psi.pshell.swing.Shell as Shell while (True): key=Shell.waitKey(0) if key == 0x25 : #Left motor.moveRel(-step) elif key == 0x27 : #Right motor.moveRel(step)