需要先安装python3.2 然后安装python3.2对应的PyQt4界面库版本
<span import</span><span sys </span><span from</span> PyQt4 <span import</span><span QtGui , QtCore app </span>=<span QtGui.QApplication( sys.argv ) widget </span>=<span QtGui.QWidget() widget.resize( </span>250 , 150<span ) widget.setWindowTitle( </span><span '</span><span 窗口标题</span><span '</span><span ) </span><span #</span><span 设置图标</span> widget.setWindowIcon( QtGui.QIcon( <span '</span><span 16-111129230521</span><span '</span><span ) ) </span><span #</span><span 设置窗口中间部分的文字tip提示</span> widget.setToolTip( <span '</span><span <b>文字提示:::</b></span><span '</span><span ) QtGui.QToolTip.setFont( QtGui.QFont( </span><span '</span><span OldEnglish</span><span '</span> , 12<span ) ) </span><span #</span><span 退出按钮</span> quit = QtGui.QPushButton( <span '</span><span 退出</span><span '</span><span , widget ) quit.setGeometry( </span>10 ,20 , 50 ,30<span ) </span><span #</span><span 退出按钮 连接 到py的信号槽机制</span> widget.connect( quit , QtCore.SIGNAL( <span '</span><span clicked()</span><span '</span> ) , QtGui.qApp , QtCore.SLOT( <span '</span><span quit()</span><span '</span><span ) ) reply </span>= QtGui.QMessageBox.question( widget , <span '</span><span message</span><span '</span> , <span '</span><span 问题?</span><span '</span><span , QtGui.QMessageBox.Yes , QtGui.QMessageBox.No ) </span><span #</span><span 显示窗体部件</span> <span widget.show() sys.exit( app.exec_() )</span>