开始Python之旅

参照

http://www.saltycrane.com/blog/2007/01/how-to-install-pyqt-41-python-25-and-qt_8340/

安装PyQT4环境。

 

Here are the steps to install and create a simple "Hello World" GUI application using PyQt 4.4, and Python 2.5, on Windows.


Install Python 2.5

  1. Go to http://www.python.org/download/ and click on "Python 2.5.x Windows installer"
  2. Save and run the Windows installer
  3. Go through the steps and accept the defaults.


Install the PyQt 4.4 bundle (including QT 4.4)

  1. Go to http://www.riverbankcomputing.co.uk/software/pyqt/download and select the "PyQt-Py2.5-gpl-4.4.2-1.exe" link.
  2. Save and run the file.
  3. Go through the steps and accept the defaults.


Run a "Hello World" application

  1. Go to "Start" -> "All Programs" -> "Python 2.5" -> "IDLE (Python GUI)"
  2. Open a new window ("File" -> "New window")
  3. Type the following code inside and save:
    import sys
    from PyQt4.QtGui import *
    app = QApplication(sys.argv)
    button = QPushButton("Hello World", None)
    button.show()
    app.exec_()
  4. Hit "F5" to run. A window with a single push button should pop up.

For more examples, go to "Start" -> "All Programs" -> "PyQt GPL v4.4.2 for Python v2.5" > "Examples" > "PyQt Examples Source" (For a default installation, this is also located at C:/Python25/PyQt4/examples .) To start, look in the "tutorial" directory.

 

安装Python 2.7和对应的PyQT4-Py2.7包成功,不再需要另装MinGW。

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值