09 2013 档案

【Python】GUI 练习1--利率计算器
摘要:import sysfrom PyQt4.QtCore import *from PyQt4.QtGui import *class Form(QDialog): def __init__(self,parent=None): super(Form,self).__init__(parent) prinlabel=QLabel('Principal: ') ratelabel=QLabel('Rate: ') yearlabel=QLabel('Years: ') amountlabel... 阅读全文

posted @ 2013-09-23 16:05 colipso 阅读(875) 评论(0) 推荐(1) 编辑

【python】计算器
摘要:from __future__ import divisionimport sysfrom math import *from PyQt4.QtCore import *from PyQt4.QtGui import *class Form(QDialog): def __init__(self,parent=None): super(Form,self).__init__(parent) self.browser=QTextBrowser() self.Lineedit=QLineEdit('Type an expression and pre... 阅读全文

posted @ 2013-09-05 23:14 colipso 阅读(331) 评论(0) 推荐(0) 编辑

【python】模块测试 if name main
摘要:verbose=1def listing(module): if verbose: print '-'*30 print 'name:',module.__name__,'file:',module.__file__ print '-'*30 count=0 for attr in module.__dict__.keys(): print "%02d) %s" % (count,attr) if attr[0:2]=='__': print '' els... 阅读全文

posted @ 2013-09-05 15:24 colipso 阅读(263) 评论(0) 推荐(0) 编辑

【python】map list for 运行时长测试
摘要:import time,sysreps=1000size=10000def tester(func,*args): starttime=time.time() for i in range(reps): func(*args) spendtime=time.time()-starttime return spendtimedef forstst(): res=[] for x in range(size): res.append(abs(x))def liststst(): res=[abs(x) for x in rang... 阅读全文

posted @ 2013-09-03 16:42 colipso 阅读(651) 评论(0) 推荐(0) 编辑

【python】函数参数-任意参数
摘要:def min1(args): res=args[0] for arg in args[1:]: if arg<res: res=arg return resdef min2(first,rest): for arg in rest: if arg<first: first=arg return firstdef min3(args): tmp=list(args) tmp.sort() return tmp[0]print 'Please in put a min func... 阅读全文

posted @ 2013-09-02 12:10 colipso 阅读(450) 评论(0) 推荐(0) 编辑

< 2025年3月 >
23 24 25 26 27 28 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31 1 2 3 4 5

导航

统计

点击右上角即可分享
微信分享提示