python Programming Glossary: imagepng
Python dynamic inheritance: How to choose base class upon instance creation? http://stackoverflow.com/questions/7057019/python-dynamic-inheritance-how-to-choose-base-class-upon-instance-creation example case This script contains two classes ImageJPG and ImagePNG both inheriting from the Image base class. To create an instance.. class. Both concrete image classes ImageJPG and ImagePNG are able to decode files via their data property. Both do this.. format 'jpg' return ImageJPG path if format 'png' return ImagePNG path else raise Exception 'The format ' format ' is not supported.'..
|