Created
August 27, 2014 05:24
-
-
Save yanolab/db6f870ec08b58852e2f to your computer and use it in GitHub Desktop.
Save image from clipboard to local file.
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/env python | |
# -*- coding: utf-8 -*- | |
import sys | |
import gtk | |
def save_clipimg(filename): | |
clipboard = gtk.clipboard_get() | |
image = clipboard.wait_for_image() | |
if image is not None: | |
image.save(filename, "png") | |
else: | |
print("No image in clipborad.") | |
def main(): | |
save_clipimg((sys.argv+["clipboard.png"])[1]) | |
main() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment