I am running a very basic example in PyQt4. It is shown below. I was struggling with the Enthought Canopy installation, struggling with the cygwin Python implementation, and finally just installed Python 2.7, Numpy 1.7.1, MatPlotLib 1.2.0 one at a time.
When I execute the example from IDLE, it works fine. Although when I try to execute it from Notepad++ using nppExec, the console window just hangs. I do not see a little empty window pop up anywhere, nor am I given any error codes.
- I tried interactive mode and non-interactive mode from nppExec (-i)
- My nppExec command is
python "$(FULL_CURRENT_PATH)"
- My nppExec command is
- I tried pulling the guts of tho code out of the function definition and running it by itself, same thing.
.
- Python 2.7.4
- notepad++ 6.3.2
PyQt4 4.10.1
import sys from PyQt4 import QtGui def main(): app = QtGui.QApplication(sys.argv) w = QtGui.QWidget() w.resize(250, 150) w.move(300, 300) w.setWindowTitle('Brian') w.show() sys.exit(app.exec_()) if __name__ == '__main__': main()
In NppExec, use the command
instead of
I had/have the same issue. Using
w.showMaximized()
instead ofw.show()
solved for me the problem of not showing the window in Notepad++. Subsequent opened widgets can be opened withw.show()
.However, your code did not work for me, I got a Python traceback. Instead I used (with PySide):
And, as a work-around, just add something like
w.resize(width, height)
after you calledw.showMaximized()
to resize the window to your target size.