#!/usr/bin/env python
# -*- coding: UTF-8 -*-

import ImageGrab
import Image

def saveimg():
    #Όμ²ιΌτΗΠ°εΦΠΚΗ·ρΣΠΝΌΖ¬
    im = ImageGrab.grabclipboard()
    if isinstance(im, Image.Image):
        print '... got an image ...'
        im.save("copy.jpg")
        return 1
    elif im:
       for filename in im:
           try:
               im = Image.open(filename)
           except IOError:
               pass # ignore this file
           else:
               print '... got an image ... 1'
               return 2
    else:
        print '... clipboard empty ...'
        return 0