lego python code