Enthought Canopy - passing sys.argv from PySide Qt program
- by user2541559
I've recently been looking at the Enthought distro of iPython. Today I decided to see if I could get some Qt GUI progs running and was successful after making minor changes. Simple example:
import sys
from PySide import QtGui # was 'from PyQT4 import QtGui'
# app = QtGui.QApplication(sys.argv) -- not needed
win = QtGui.QWidget()
win.resize(320, 240)
win.setWindowTitle("Hello MIT 6X!")
win.show()
sys.exit() # was 'sys.exit(app.exec_())'
But I would like to be able to pass sys.argv in some cases. Most example code I see is in the form of the commented out 'app = ' line above. If I include it, I get 'RuntimeError: A QApplication instance already exists.' Suggestions for passing arguments appreciated.
Nick