No name ‘QApplication’ in module ‘PyQt5.QtWidgets’ error in Pylint

I’ve figured out the issue, apparently Pylint doesn’t load any C extensions by default, because those can run arbitrary code. So I found that if you create a system file in your project directory with the file named .pylintrc the rc file can whitelist this package to stop throwing errors by adding the following code … Read more

Is there a way to take screenshot of a window in pyqt5 or qt5?

Ref: http://doc.qt.io/qt-5/qscreen.html#grabWindow You say you require a screenshot of a window, therefore screenshot = screen.grabWindow(0, 0, 0, 100, 100) is not the appropriate call here, since it captures the entire screen, cropped according to the final 4 parameters. (the 100 parameters are width and height). screenshot = screen.grabWindow( widget.winId() ) captures the widget window. However, … Read more

Scraping Javascript driven web pages with PyQt4 – how to access pages that need authentication?

I figured it out. Here’s what I ended up with in case it can help someone else. #!/usr/bin/python # -*- coding: latin-1 -*- import sys import base64 from PyQt4.QtGui import * from PyQt4.QtCore import * from PyQt4.QtWebKit import * from PyQt4 import QtNetwork class Render(QWebPage): def __init__(self, url): self.app = QApplication(sys.argv) username=”username” password = ‘password’ … Read more

PyQt5 and QtGui module not found

When first trying pyqt4 and pyqt5 and the pycharm IDE I had many problems with imports. (although the imports had no prob running from IDLE) Eventually after much stuffing around, uninstalling and reinstalling, (including dependencies) the imports sorted themselves out. Did you install pyqt5 using an installer from the pyqt website? You must. Qt designer … Read more