既然能够用python解析rss,那么也顺带研究下生成rss。其实很简单,只是生成一个比较特殊点的xml文档而已。这里我使用了PyRss2Gen,用法很简单,看代码就知道了,如下:
1 import datetime 2 import PyRSS2Gen 3 4 rss = PyRSS...
分类:
编程语言 时间:
2014-05-18 20:37:33
阅读次数:
481
题目:查找元素target插入一个数组中的位置。代码:public int
searchInsert(int[] A, int target) { int len = A.length; int i; for(i = 0 ; i
< len ; i++){ ...
分类:
其他好文 时间:
2014-05-18 20:28:13
阅读次数:
299
思路:枚举然后深搜,时间复杂度有点高。代码: 1 #include 2 #include 3
#include 4 #include 5 using namespace std; 6 int a[25]; 7 char c[25]; 8 int
flag; 9 int len;10 int judg...
分类:
其他好文 时间:
2014-05-18 19:51:19
阅读次数:
341
1.根据要求创建列表threes_and_fives(列表值包括1到15中能够被3或者5正常的数)threes_and_fives=[x
for x in range(1,16) if x%3==0 or x%5==0]2.lambda表达式实例(剔除掉列表中的”X“)garbled =
"IXXX...
分类:
编程语言 时间:
2014-05-18 19:48:23
阅读次数:
397
sorted函数:iterable:是可迭代类型;cmp:用于比较的函数,比较什么由key决定,有默认值,迭代集合中的一项;key:用列表元素的某个属性和函数进行作为关键字,有默认值,迭代集合中的一项;reverse:排序规则.
reverse = True 或者 reverse = False,有...
分类:
编程语言 时间:
2014-05-17 23:36:24
阅读次数:
511
取的文件大小1.int fd = open("data.txt",O_RDONLY); int
len = lseek(fd,0,SEEK_END);2.structstatsb; if ((fstat(fd, &sb)) == -1) {
perror("fstat"); }sb.st_size3...
分类:
编程语言 时间:
2014-05-17 21:24:29
阅读次数:
267
文件可以通过调用open或file来打开,open通常比file更通用,因为file几乎都是为面向对象程序设计量身打造本文地址:http://www.cnblogs.com/archimedes/p/python-file.html,转载请注明源地址。打开文件打开文件程序会调用内置的open函数,首...
分类:
编程语言 时间:
2014-05-17 18:58:06
阅读次数:
419
一,安装基础环境
1,安装jdk7,并配置环境变量(pyDev要求jdk7及以上版本,否则安装好也不显示) 2,下载Eclipse并解压
3,安装python3.X二,Eclipse下配置pyDev 1,安装插件:help -> Install new Software..
->输入PyDe...
分类:
编程语言 时间:
2014-05-17 18:54:51
阅读次数:
322