
python
文章平均质量分 57
rea_1121
找兼职,想参加有趣的项目
愿意积极学习~
电话:13391687745
qq: 289169301
展开
-
QTextEdit和QTextDocument(一)
QTextEdit简介: 它可以显示rict text。 这里的rich text不是指microsoft的ricth text,而是用html标签表示的形式。 它通过viewport显示大型文件,而且性能好,可以快速响应用户的操作。 以paragraph和character为基本单位工作。paragraph是格式化的字符串,自动word-wrap以适应容器的大小。一个document由paragraph组成。paragraph可以有自己的alignment属性,paragragh之间由hard li原创 2011-05-19 14:27:00 · 21683 阅读 · 0 评论 -
python tutorial 学习笔记(七)Errors and Exceptions
try, except, raise,finally raise raise NameError,’HiThere’ raise NameError(‘HiThere’) raise Class,instance raise instance raise can be used to re-raise the exception directly. User-defined Exceptions: Should be derived from the Exception class.原创 2011-04-25 14:59:00 · 412 阅读 · 0 评论 -
python tutorial 学习笔记(六)class
class ClassName( SuperClass ) : A new name space is created, thus all assignments to local variables go into this new namespace. When a class definitition ends, a class object is created. attribute names: __doc__( the fist multil-line string ), __cl原创 2011-04-20 16:59:00 · 474 阅读 · 0 评论 -
python tutorial 学习笔记 (五) scope,namespace
Namespace A mapping from name to objects. Names in different namespaces have no relation at all. Most namespaces are currently implemented as Python dictionaries e.g.: the set of built-in names; global names in a module; local names in a function invocati原创 2011-04-20 15:01:00 · 1403 阅读 · 0 评论 -
python tutorial 学习笔记(四) Input and Output, 字符串的转换等
print object value in the interpreter shell: expression statment print keyword print a,b,c sys.stdout.write() string module transfer objects to string str() function: human readble repr() function: can be read by the interpreter str原创 2011-04-15 14:36:00 · 583 阅读 · 0 评论 -
Qt: Resource System
http://doc.trolltech.com/latest/resources.html qrc文件: xml格式的qrc文件,给出资源名字和磁盘上资源之间的联系。例如 images/cut.png images/new.png images/open.png images/paste.png images/save.png file的alias属性给资源一个额外的名字 qresource的prefix属性原创 2011-05-25 16:19:00 · 993 阅读 · 0 评论 -
python tutorial 学习笔记(三)
module –> .py file import module_name from module_name import * module_name.__name__ #returns the module name module can contain executable statments. They are executed only the first time the module is imported somewhere. __na原创 2011-04-01 18:14:00 · 471 阅读 · 0 评论 -
python tutorial 学习笔记(二) Sequence type
built-in functions: range() len(object) keyword in, return boolean filter(function,sequence) map(function,*sequence) reduce(function,sequence) enumerate(object) –> [(0,item0),(1,item1),…] zip(seq1,seq2,…) –> [ (seq1[0],seq2[0]), (seq1[1],seq2[1] ),原创 2011-04-01 15:58:00 · 490 阅读 · 0 评论 -
python tutorial 学习笔记(一)
built-in funcitons raw_input([String]) range(int,[int],[int]) keyword lambda: small anonymous function control flow: if,elif,else ( no switch in python) for x in a; for x in a[:]; it iterates aan array while break,continue pass Define Functions:原创 2011-04-01 13:57:00 · 441 阅读 · 0 评论 -
python碎碎念(一)
python对象的复制 python中的类型为序列型或者类的变量,在传递的过程中都是传引用。如何复制对象的值而不是其引用呢? 工厂方法:list() dict()等 dict: copy() 方法 , list: [:] slice copy 以上为浅拷贝(shallow copy),一般来说已经够用。但是当对象内部还有其他类似的变量引用时,所生成的拷贝里是保留引用呢,还是也做一份复制呢? 如果也做一份复制,那就用到深层拷贝(deep copy)。有个模块copy专门做这个事情。原创 2011-05-01 23:24:00 · 535 阅读 · 0 评论