Forums

Import of Qt4Gui causes an error

I'm using flask trying to make an app. I 'm trying to import QtGui like this:

from PyQt4 import QtGui

but this crashes the app: 'Something went wrong :-(' blah blah...

Without this import I get no error.

How can I import QtGui?

I'm a bit confused -- QtGui is for graphical user interfaces, so it won't work in a website's server process. What are you trying to do with it?

What I'm trying to do is to convert a desktop app I have made with python to a web app. It contains QtGui.

So, I can't use it.

This app is doing HTML Scraping (takes data from another web page).

I use this:

self.mainFrame().load(QtCore.QUrl(self._url))

Can I somehow replace the QtCore.QUrl(self._url) as nor QtCore can be used?


I read here: "pythonanywhere does not allow you to refer any external sites in your web app", so I suppose I can't do what I want with pythonanywhere (I have a free account).

Yes, that's right. Free accounts can only access sites on our whitelist, which is a set of sites that explicitly allow programmatic access (mostly APIs). So if you're doing web-scraping, you'd need a paid account.