I have multiple JPG files in a folder. I want to copy all of them to clipboard in one go, so when I press ctrl+v I can paste them.
Shutil will copy and past files from dict to dict:
from PyQt6 import QtCore, QtGui
for _ in range(10):
app = QtGui.QGuiApplication([])
data = QtCore.QMimeData()
url = QtCore.QUrl.fromLocalFile(full_file_name)
data.setUrls([url])
app.clipboard().setMimeData(data)
This code will only copy one random image to the clipboard from the path I set. If I loop through all the files it crashes.