lyse.utils.tempfile2clipboard

This is a stand-alone script which copies an image to the clipboard and then optionally deletes the image file.

usage:

python tempfile2clipboard.py [–delete] image_filepath

After copying the image data to the clipboard, this script optionally deletes the image file, if the –delete argument is provided, and then continues running until the clipboard data changes.

This is due to the way in which some clipboards work - data is not requested from the application until it is pasted somewhere, and so the application doing the copying must still be running. It is also useful to have this functionality be a stand-alone script since it requires a Qt mainloop, and this way we avoid corner-cases of how this may interfere with any use of Qt in the calling program.

Functions

main()