Are there any Python3 modules used to program robotic movement by declaring a device or component and then providing the instructions? I am not looking for modules that test the components.

  • $\begingroup$ Hi Devyn, this question as written is going to elicit very subjective answers. Can you rephrase it a little bit to describe what "easy" means as far as your specific application? $\endgroup$
    – Ian
    Jul 1, 2013 at 16:03

1 Answer 1


This is an extremely general question. What code you will use will depend on the type of "robotic movement" you are attempting to achieve, and what platform you are running the code on.

Let's say you want to control a stepper motor from python running on a Raspberry Pi. Stephen Phillips has written a nice python class for this purpose. The code was for Python 2.x, but the only changes you need to make to port it to python 3 are to add parenthesis to the print statements and change the backticks to repr() because python 3 has cleaned up the print syntax. See the output of python's 2to3 command below:

@@ -41,10 +41,10 @@
         steps = (steps % self.steps_per_rev)
         if steps > self.steps_per_rev / 2:
             steps -= self.steps_per_rev
-            print "moving " + `steps` + " steps"
+            print("moving " + repr(steps) + " steps")
             self._move_acw(-steps / 8)
-            print "moving " + `steps` + " steps"
+            print("moving " + repr(steps) + " steps")
             self._move_cw(steps / 8)
         self.step_angle = target_step_angle

@@ -98,7 +98,7 @@
     m = Motor([18,22,24,26])
     m.rpm = 5
-    print "Pause in seconds: " + `m._T`
+    print("Pause in seconds: " + repr(m._T))

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.