Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
class Base :
    def __init__(self) :
       ...
       
class Derived(Base) :
    def __init__(self) :
        Base.__init__(self)
        # OR
        super(Derived, self).__init__()   

 

Create/save temporary file

Code Block
import tempfile
tmp_file = tempfile.NamedTemporaryFile(mode='r+b',suffix='.tiff')
tfile = tmp_file.name

 

 

 

Python - useful references

...

Grab image from monitor

Code Block
    import tempfile    
    def grabImage(self):
        fname = tempfile.NamedTemporaryFile(mode='r+b',suffix='.ppm')
        if( 0 == os.system('import -trim -frame -border %s' % (fname.name))) :
            self.r_pixmap = QtGui.QPixmap(QtGui.QImage(fname.name,'.ppm')) 
            self.setPixmapForImage()

...