In the past, this worked but now is broken:
- I had my work computer "upgraded" to Windows 7. I had to re-install Python(x,y) and I use Spyder.
Code I have that uses PyQt4 will run the first time I open it, but if I try to run it a second time without a new session, I get the error
QWidget: Must construct a QApplication before a QPaintDevice
A third attempt gives me a pop up window that tells me that there's no current Python shell selected to run.
I think this is a problem with the setup of Python(x,y) as opposed to a PyQt4 issue.
When run, program pops up a window where user is prompted to choose specific files and enter some text. When they hit the button at the bottom, plots are generated etc and a pdf report is produced. I use Python(x,y), specifically Spyder. Until IT seized my computer to "upgrade" to Windows 7 and deleted all of my Python stuff, it would work. Now, when I run it, I get the error above if I try to run it a second time. I end up having to quit python(x,y) and restart it every time I want to run a report.
class CompiledWindow(QtGui.QWidget):
.....
app = QtGui.QApplication(sys.argv)
cw = CompiledWindow()
cw.show()
app.exec_()