import sys; from PyQt4 import QtCore, QtGui; app=QtGui.QApplication(sys.argv); widget=QtGui.QWidget(); widget.resize(600,400); widget.show(); app.exec_();环境:windows7+python2.7+PyQt4