There is (was) a commercial product that was a UML editor with Python extensions and the ability to import Python. The name was object...somethingorother but I no longer have it and cannot recall or find a ref to it.