I have figured out an answer to the second part of my question: as suggested in this answer, I must have the function return anim
. But I remain somewhat confused as to why Canopy and the other interpreters behave differently here. (Why do IDLE and PyLab work?) Any insight would be appreciated!