Drawbot is a well known library to write simple Python scripts to generate two-dimensional graphics. It also has sevaral use in typeface design. The builtin graphics primitives support rectangles, ovals, (bezier) paths, polygons, text objects and transparency.
DrawBot is an ideal tool to teach the basics of programming. Students get colorful graphic treats while getting familiar with variables, conditional statements, functions and what have you. Results can be saved in a selection of different file formats, including as high resolution, scaleable PDF, svg, movie, png, jpeg, tiff… DrawBot has proven itself as part of the curriculum at selected courses at the Royal Academy in The Hague.