07 2011 档案
**pyqt_example_learn<wizard>
摘要:#-*- coding:gb2312 -*-import sysfrom PyQt4 import QtGui,QtCoredef create_page(): page = QtGui.QWizardPage() page.setTitle('introduction') page.setSubTitle('hello') label = QtGui.QLabel('xxxxxxx') label.setWordWrap(True) layout = QtGui.QVBoxLayout() layout.addWidget(label) pag 阅读全文
posted @ 2011-07-21 08:45 eth0 阅读(241) 评论(0) 推荐(0)
*cute_py<os.walk,os.listdir,os.stat>
摘要:import sys,osdef get(path): allfile = {} for root,dirs,files in os.walk(path): for onefile in files: fname = os.path.join(root,onefile) fsize = os.stat(fname).st_size if allfile.has_key(fsize): allfile[fsize].append(fname) else: allfile[fsize] = [fname] fsize_key = allfile.keys() fsize_key.sort() re 阅读全文
posted @ 2011-07-19 16:00 eth0 阅读(294) 评论(0) 推荐(0)
**pyqt_example_learn<syntaxhighlighter>
摘要:1 from PyQt4 import QtCore, QtGui 2 3 4 class MainWindow(QtGui.QMainWindow): 5 def __init__(self, parent=None): 6 super(MainWindow, self).__init__(parent) 7 8 self.setupFileMenu() 9 self.setupHelpMenu() 10 self.setupEditor() 11 12 self.setCentralWidget(self.editor) 13 self.setWindowTitle("Synta 阅读全文
posted @ 2011-07-18 11:09 eth0 阅读(529) 评论(0) 推荐(0)
**pyqt_example_learn<calendar>
摘要:from PyQt4 import QtCore, QtGuiclass MainWindow(QtGui.QMainWindow): def __init__(self): super(MainWindow,self).__init__() self.selectedDate = QtCore.QDate.currentDate() self.fontSize = 10 centralWidget = QtGui.QWidget() dateLabel = QtGui.QLabel('date') monthCombo = QtGui.QComboBox() for mont 阅读全文
posted @ 2011-07-17 12:34 eth0 阅读(345) 评论(0) 推荐(0)
**pyqt_example_learn<dir view>
摘要:from PyQt4 import QtGuiif __name__ == '__main__': import sys app = QtGui.QApplication(sys.argv) model = QtGui.QDirModel() tree = QtGui.QTreeView() tree.setModel(model) tree.setAnimated(False) # 展开方式 tree.setIndentation(20) # 压痕 tree.setSortingEnabled(True) # 排序 tree.setWindowTitle("Dir 阅读全文
posted @ 2011-07-12 10:40 eth0 阅读(195) 评论(0) 推荐(0)
**pyqt_example_learn<scribble>
摘要:import sipsip.setapi('QString', 2)sip.setapi('QVariant', 2)from PyQt4 import QtCore, QtGuiclass ScribbleArea(QtGui.QWidget): def __init__(self, parent=None): super(ScribbleArea, self).__init__(parent) self.setAttribute(QtCore.Qt.WA_StaticContents) self.modified = False self.scribblin 阅读全文
posted @ 2011-07-11 10:43 eth0 阅读(553) 评论(0) 推荐(0)
**pyqt_example_learn<style>
摘要:from PyQt4 import QtCore, QtGuiclass WidgetGallery(QtGui.QDialog): def __init__(self,parent=None): super(WidgetGallery,self).__init__(parent) self.palette = QtGui.QApplication.palette() combo_box = QtGui.QComboBox() combo_box.addItems(QtGui.QStyleFactory.keys()) label = QtGui.QLabel('style') 阅读全文
posted @ 2011-07-10 13:55 eth0 阅读(520) 评论(0) 推荐(0)
**pyqt_example_learn<wiggly>
摘要:// from pyqt_examplesfrom PyQt4 import QtCore, QtGuiclass WigglyWidget(QtGui.QWidget): def __init__(self, parent=None): super(WigglyWidget, self).__init__(parent) self.setBackgroundRole(QtGui.QPalette.Midlight) self.setAutoFillBackground(True) newFont = self.font() newFont.setPointSize(newFont.point 阅读全文
posted @ 2011-07-09 11:39 eth0 阅读(250) 评论(0) 推荐(0)
**pyqt_example_learn<shapedclock>
摘要:# from pyqt_exampleimport sysfrom PyQt4 import QtGui,QtCoreclass ShapedClock(QtGui.QWidget): hourHand = QtGui.QPolygon([ QtCore.QPoint(7, 8), QtCore.QPoint(-7, 8), QtCore.QPoint(0, -40) ]) minuteHand = QtGui.QPolygon([ QtCore.QPoint(7, 8), QtCore.QPoint(-7, 8), QtCore.QPoint(0, -70) ]) hourColor = Q 阅读全文
posted @ 2011-07-07 14:29 eth0 阅读(328) 评论(0) 推荐(0)
**pyqt_example_learn<calculate>
摘要:// calculate 1 # coding = gbk 2 import sys 3 from PyQt4 import QtCore,QtGui 4 5 class Button(QtGui.QToolButton): 6 def __init__(self,text,parent=None): 7 super(Button,self).__init__(parent) 8 self.setSizePolicy(QtGui.QSizePolicy.Expanding,QtGui.QSizePolicy.Preferred) 9 self.setText(text) 10 11 clas. 阅读全文
posted @ 2011-07-07 12:06 eth0 阅读(330) 评论(0) 推荐(0)
*py_描述符
摘要:##实现了__get__ and __set__ 的描述符称为数据描述符##只实现__get__的描述符称为非数据描述符## 描述符类 <定义另一个类特性可能访问方式的类>class upper_string(object): def __init__(self): self._value = '' def __get__(self,instance,klass): return self._value def __set__(self,instance,value): self._value = value.upper()class mine(object): a 阅读全文
posted @ 2011-07-06 21:16 eth0 阅读(179) 评论(0) 推荐(0)
**pyqt_example_learn<clock>
摘要:1 import sys 2 from PyQt4 import QtGui,QtCore 3 4 class Time(QtGui.QLCDNumber): 5 def __init__(self,parent=None): 6 QtGui.QLCDNumber.__init__(self,parent) 7 #self.setFixedSize(200,200) 8 self.setSegmentStyle(QtGui.QLCDNumber.Filled) 9 timer = QtCore.QTimer(self)10 timer.timeout.connect(self.show_ti. 阅读全文
posted @ 2011-07-06 14:05 eth0 阅读(171) 评论(0) 推荐(0)
*pyqt_one<lcdnumber spinbox slider>
摘要:class Dialog(QtGui.QDialog): def __init__(self): QtGui.QDialog.__init__(self) self.setFixedSize(200,200) self.spinbox = QtGui.QSpinBox() self.spinbox.setRange(0,100) self.spinbox.setValue(50) self.slider = QtGui.QSlider(QtCore.Qt.Horizontal) self.slider.setRange(0,100) self.lcd = QtGui.QLCDNumber(5) 阅读全文
posted @ 2011-07-06 13:09 eth0 阅读(357) 评论(0) 推荐(0)
*苏轼_<江城子*密州出猎>
摘要:苏轼_<江城子*密州出猎> 老夫聊发少年狂,左牵黄,右擎苍。 锦帽貂裘,千骑卷平冈。 为报倾城随太守,亲射虎,看孙郎。 酒酣胸胆尚开张,鬓微霜,又何妨! 持节云中,何日遣冯唐? 会挽雕弓如满月,西北望,射天狼。------勉 阅读全文
posted @ 2011-07-02 19:44 eth0 阅读(134) 评论(0) 推荐(0)