vim python代码自动折叠
http://vim.sourceforge.net/scripts/script.php?script_id=515
zo 展开
zc 收起
zn 全部展开
zN 全部折叠
python xml 处理
原:http://hi.baidu.com/heelenyc/blog/item/4062fd0b57c75294d1581b09.html
最好的还是dive into python http://woodpecker.org.cn/diveintopython/xml_processing/attributes.html
和http://www.w3school.com.cn/xmldom/dom_element.asp
python 使用base64加解密
原:http://hi.baidu.com/key1088/item/fb11c782b55a7ce1e596e041
python 使用base64加解密
1.最简单的加解密实例,字符串
import base64
str1 = ‘hello'
print str1
str2 = base64.b64encode(str1)
print str2
str3 = base64.b64decode(str2)
print str3
2.针对文件加解密
import base64
f1=open('1.txt','r')
f2=open('2.txt','w')
base64.encode(f1,f2) #加密,把f1的内容加密后写入f2
#base64.decode(f1,f2) #解密,把f1的内容解密后写入f2
f1.close()
f2.close()