programming-humanoid-robot-in-python
programming-humanoid-robot-in-python copied to clipboard
Make necessary changes for Python 3 in joint_control
The changes have intentionally been kept minimal to make them easier to verify. The Notebooks would likely benefit from a re-run afterwards though, to upgrade their internal version numbers.
The fixes are as follows:
-
print(data)instead ofprint data, as print became a function in Python 3 instead of a keyword. Also f-Strings have been used, assuming a non-EOL-Python (supported since 3.6), since they are shorter than a.format(). -
open(filename, 'rb')forpickle.loadsince the latter requires a function returning bytes instead of strings so the file has to be opened in binary mode. - The imports in init.py have to be changed to be relative to the base module name. Otherwise just a
ModuleNotFoundError: No module named 'hello'results. - In sexpr.py the
import futurehas been dropped since it is obsolete and unused and the shebang has been dropped since the file has no main function. - In learn_posture.ipynb it has been noticed, that the
listdir()-Function returns a list in arbitrary (undefined and may change from run to run) order. This has been resolved by simply sorting it.