一、wxPytris介绍:
OSC的介绍页:PyQt开发的俄罗斯方块游戏 wxPytris
wxPytris源码主页:http://eli.thegreenplace.net/2009/12/12/tetris-implemented-in-pyqt/
二、查看源码的心得:
- wxPytris引用“base64”、“pickle”两个模块,可用于将数据以base64的编码存储到硬盘。
- 以前还未注意到有这种python有这种写法,附上源码段 :
return 0 if len(self.scorelist) < self.max_length else self.scorelist[-1][1]
- 源码中
比PyQt的例子from PyQt4.QtCore import * from PyQt4.QtGui import * button = QPushButton('ok')
的代码写起来方便多了。from PyQt4 import QtCore, QtGui button = QtGui.QPushButton('ok')