I’m writing simple tool to keep every image that I’ve copied (URL of image)
I’m using pythoncom and pyhook to catch keyboard “Copy” combination.
The problem here is that when Image starts downloading it causes major slowdown, so I have to wait for 0.5-2 seconds for script to finish. Here’s the code:
response = urllib2.urlopen (URL)
image_file = response.read()
file = open (path + filename, 'wb')
file.write (image_file)
file.close()
So, the question is – is there a way to get rid of this delay?
The question in its current state (unedited) is not really that clear. But I am under the impression your problem is the fact you have to download the image from somewhere before processing it. To get around that, I would use either of the two: