I was wondering if there was a way to do this in Python:
- From a directory, select multiple specific files (e.g. .JPG and .PNG), copy the files and paste it into another application.
I know that if we are just moving the files to another directory we can do something like:
for files in glob.glob(r'*PNG'):
shutil.copy(files, dir)
But this won't allow me to copy to the clipboard so I can just paste the files. I've tried looking at pyperclip
but that would only allow for strings.
So basically what I tried is Ctrl + A, Ctrl + C and pasting it (using pynput.keyboard
) into an application. However this method, doesn't allow me to copy only specific files.