I am trying convert my code from PyQt4 to PyQt5 but I am getting errors.
import sys
from PyQt5.QtGui import QPixmap
from PyQt5.QtWidgets import QApplication
from datetime import datetime
date = datetime.now()
filename = date.strftime('%Y-%m-%d_%H-%M-%S.jpg')
app = QApplication(sys.argv)
QPixmap.grabWindow(QApplication.desktop().winId()).save(filename, 'jpg')
Traceback (most recent call last):
File "C:\Python34\Projects\name.py", line 9, in <module>
QPixmap.grabWindow(QApplication.desktop().winId()).save(filename, 'jpg')
AttributeError: type object 'QPixmap' has no attribute 'grabWindow'