Python: implementation of tracking functions and commands