Kig is a free an open source interactive geometry software, which is part of the KDE edutainment project. It has some facilities for scripting in Python, as well as the creating macros from existing constructions.