Some steps to help convert C++ example programs to python: * Change the file name from ".cpp" to ".py" * Remove all ";", "{", and "}" the meanings these delimiters are implied by line endings and indentation in python * Replace "//" comment characters with "#" * Replace "::" scope delimiters with "." * Verify that all indentation in the file is consistent. Use only spaces, not tabs for indentation. * Replace "#include" statements with corresponding "import" statements e.g. '#include "SimTKsimbody.h"' becomes "import simbios.simbody" (but really use "import simbios.simtk as simtk") * "using namespace SimTK" becomes "from simbios.simtk import *" (but don't do that, use the simtk namespace, like above) * rearrange variable declarations with constructors like so: "SimTK::Blah var(foo);" to "var = simtk.Blah(foo)" * remove type declarations from new variables "int x = foo();" becomes "x = foo()" * change function invocations from "double foo(int x) {" to "def foo(x):" * If there is a "main" method, put the following at the end of your script: if __name__ == '__main__': main() * replace "for" loops like "for (int i = 0 i < 10 ++i) {" with "for i in range(10):" * (optional) it is permitted to replace simtk.Vec3's in function calls with python tuples, for compactness "foo(simtk.Vec3(1,2,3))" can be replaced with "foo((1,2,3)) * (optional) some simtk getFoo() and updFoo() method calls can be replaced with properties "system.updDefaultSubsystem()" becomes "system.defaultSubsystem" * remove "new" keyword from allocations "new Blah()" becomes "Blah()" * Extending a single statement onto multiple lines is only permitted if: the linebreak occurs between parentheses OR the linebreak is escaped with a "\" character * replace boolean constants "true" and "false" with "True" and "False", respectively. (note initial capital letter) * Add "self" as the first argument to all member functions. * Precede all member function calls within member functions with "self.", e.g. "foo()" becomes "self.foo()"