代码改变世界

随笔档案-2011年12月

"仿matlab科学软件"项目准备

2011-12-08 17:11 by Rollen Holt, 950 阅读, 收藏, 编辑
摘要: 最近会发一些小的零散的文章,为自己的寒假的项目做准备#coding=utf-8import matplotlib.pyplot as pltfig=plt.figure("hello") #设置标题栏fig.suptitle("bold figure suptitle",fontsize=12,fontweight="bold")ax = fig.add_subplot(111)fig.subplots_adjust(top=0.85)ax.set_title('axes title')ax.set_xlabel(&q 阅读全文

python操作gmail

2011-12-08 13:48 by Rollen Holt, 1599 阅读, 收藏, 编辑
摘要: import imaplib, reclass pygmail(object): def __init__(self): self.IMAP_SERVER='imap.gmail.com' self.IMAP_PORT=993 self.M = None self.response = None self.mailboxes = [] def login(self, username, password): self.M = imaplib.IMAP4_SSL(self.IMAP_SERVER, self.IMAP_PORT) rc, self.response = self. 阅读全文

BeautifulSoup学习笔记

2011-12-01 23:08 by Rollen Holt, 976 阅读, 收藏, 编辑
摘要: from BeautifulSoup import BeautifulSoupimport redoc = ['<html><head><title>Page title</title></head>', '<body><p id="firstpara" align="center">This is paragraph <b>one</b>.', '<p id="secondpara" 阅读全文

python的xml.dom学习笔记

2011-12-01 20:14 by Rollen Holt, 5015 阅读, 收藏, 编辑
摘要: 首先说一下,由于这篇文章主要是自己随性学习写的,所以读者看起来可能很乱,呵呵。可以给大家稍微推荐一篇:http://www.cnblogs.com/xuxm2007/archive/2011/01/16/1936610.html稍微清晰一点#coding=utf-8#解析xml文件中的所有的link标签from xml.dom import minidomfrom xml.dom.minidom import getDOMImplementationdoc=minidom.parse("d:\\hello.html")nodes=doc.getElementsByTagNa 阅读全文

python的HTMLParser学习

2011-12-01 18:55 by Rollen Holt, 15093 阅读, 收藏, 编辑
摘要: 先来大致看看HTMLParser的源代码吧:"""A parser for HTML and XHTML."""# This file is based on sgmllib.py, but the API is slightly different.# XXX There should be a way to distinguish between PCDATA (parsed# character data -- the normal case), RCDATA (replaceable character# data -- on 阅读全文