Created
September 15, 2012 16:19
-
-
Save ayosec/3728656 to your computer and use it in GitHub Desktop.
Create images from clipboard
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
# | |
# Usage: python paste_img.py dest_file.png | |
# | |
# This program readd the image stored in the clipboard, and dumps it into a file | |
import gtk, pygtk | |
pygtk.require('2.0') | |
import sys | |
dest_file = sys.argv[1] | |
clipboard = gtk.clipboard_get() | |
image = clipboard.wait_for_image() | |
image.save(dest_file, dest_file.split(".")[-1]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment