Notepad++ を使用して pyqt4 の例を実行しようとしています。私は以前にこの質問をし ( PyQt4 サンプル コードを実行すると何も起こらない)、最終的に Enthought Canopy とすべての python の残りをアンインストールし、cygwin をインストールしました。ここで、サンプル コードを実行すると、npp のコンソールから次のエラーが表示されます。nppExec コマンド --> C:\cygwin\bin\python2.7.exe -i "$(FULL_CURRENT_PATH)"
. サンプルコードは一番下に表示されています。
最も近い方法は、cygwin x を起動して (bash シェルから startx と入力)、サンプル ウィンドウが表示されるようにすることですが、ウィンドウを終了することはできません。
私はここで頭がいっぱいになっているように感じます.単純なGUIを作成したいだけで、例を機能させるのに苦労しています. Cygwin の python インストールには従来の IDLE がありませんか?
C:\cygwin\bin\python2.7.exe -i "C:\Users\Brian\Dropbox\Python\PYqt_practice.py"
Process started >>>
cygwin warning:
MS-DOS style path detected: C:\Users\Brian\Dropbox\Python\PYqt_practice.py
Preferred POSIX equivalent is: /cygdrive/c/Users/Brian/Dropbox/Python/PYqt_practice.py
CYGWIN environment variable option "nodosfilewarning" turns off this warning.
Consult the user's guide for more details about POSIX paths:
http://cygwin.com/cygwin-ug-net/using.html#using-pathnames
C:\Users\Brian\Dropbox\Python\PYqt_practice.py: cannot connect to X server
<<< Process finished. (Exit code 1)
================ READY ================
PyQt4 サンプルコード
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('Simple')
w.show()
sys.exit(app.exec_())
if __name__ == '__main__':
main()