Python agent for tangram