![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
Python
文章平均质量分 77
随遇而安随缘一世
这个作者很懒,什么都没留下…
展开
-
python对XML的解析
python有三种方法解析XML,SAX,DOM,以及ElementTree###1.SAX (simple API for XML ) pyhton 标准库包含SAX解析器,SAX是一种典型的极为快速的工具,在解析XML时,不会占用大量内存。但是这是基于回调机制的,因此在某些数据中,它会调用某些方法进行传递。这意味着必须为数据指定句柄,以维持自己的状态,这是非常困难的转载 2012-07-24 13:02:18 · 509 阅读 · 0 评论 -
zip in python
zip([iterable, ...])This function returns a list of tuples, where the i-th tuple contains the i-th element from each of the argument sequences or iterables. The returned list is truncated in length转载 2013-08-03 06:59:02 · 903 阅读 · 0 评论 -
Data Structure
5.1. More on ListsThe list data type has some more methods. Here are all of the methods of list objects:list.append(x)Add an item to the end of the list; equivalent to a[len(a):] = [x].list.原创 2013-08-03 07:12:37 · 1004 阅读 · 0 评论 -
Python Class
class A(object): def __init__(self): self.x = 'Hello' def method_a(self, foo): print self.x + ' ' + foo... the self variable represents the instance of the object itself原创 2013-08-03 07:18:43 · 811 阅读 · 0 评论 -
Sorting Mini-HOW TO
Original version by Andrew Dalke with a major update by Raymond HettingerContentsSorting Mini-HOW TOSorting BasicsKey FunctionsOperator Module FunctionsAscending and Descen原创 2013-08-03 08:06:07 · 656 阅读 · 0 评论 -
Python 之 list 使用
List有些类似于C++中的Vector,但是我感觉似乎更加的好用…这里主要说说它的一些内置方法,要创建一个list只需要使用[]括起来,就可以表示一个list。中间的各个元素可以是任何的类型,只要使用逗号分割就可以了.在list中下标是以0开始一-1结束的,因此,这里有些不同于C++或者其他语言中的下标。比如:a = [0,1,2,3,4,5,6,7,8,9,10]a[0] == 0原创 2013-08-03 07:57:51 · 561 阅读 · 0 评论 -
Object-oriented features
17.1 Object-oriented featuresPython is an object-oriented programming language, which means that it provides features that support object-oriented programming.It is not easy to define object-or转载 2013-08-03 07:23:47 · 853 阅读 · 0 评论