Esempio n. 1
0
 def __init__(self):
     '''
     @summary: Initialize
     @result: None
     '''
     super(encode, self)
     self.clip = clip.clipboard()
Esempio n. 2
0
 def encode_image(self, image, copy=None, filename=None):
     '''
     @summary: Encode Base64 from image file
     @param image: file
     @result: str base64
     '''
     with open(image, 'rb') as imagefile:
         str = base64.b64encode(imagefile.read())
         if copy:
             self.clip = clip.clipboard(str)
         if filename:
             filename.write(str)
         print str
         return str