¡@

Home 

python Programming Glossary: imagejpg

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

two images example case This script contains two classes ImageJPG and ImagePNG both inheriting from the Image base class. To create.. of the corresponding class. Both concrete image classes ImageJPG and ImagePNG are able to decode files via their data property... format os.path.splitext path 1 1 if format 'jpg' return ImageJPG path if format 'png' return ImagePNG path else raise Exception..