用python处理时间、utf8文本、正则匹配、序列化、目录路径搜索、xml解析

python 处理时间

import time
import re
now = time.strftime("%Y-%m-%d %H:%M:%S", time.gmtime())
timeobj = re.match(r'(.*)-(.*)-(.*) (.*):(.*):(.*)', now)
if timeobj is not None:
    timestamp = time.mktime(time.strptime(now, "%Y-%m-%d %H:%M:%S"))
    date = time.strftime("%Y-%m-%d %H:%M:%S", time.localtime(timestamp))


CentOS升级python到2.7版本

http://my.oschina.net/zhangdapeng89/blog/86134

How to Use UTF-8 with Python

http://www.evanjones.ca/python-utf8.html

python 读取并显示 UTF-8 中文文本

http://www.cnblogs.com/mapig/archive/2009/08/07/1541442.html

Python中文全攻略

http://www.sqlite.com.cn/MySqlite/11/395.Html

用多个分隔符正则匹配分割字符串

http://bbs.chinaunix.net/thread-1821763-1-1.html

python 正则匹配中文

http://www.blogjava.net/Skynet/archive/2009/05/02/268628.html

序列化Python对象

http://woodpecker.org.cn/diveintopython3/serializing.html


python 处理os路径

import sys
import os
if not os.path.exists('./directory/'):
    os.makedirs('./directory/')
    f = open('./directory/file', 'a')
    f.write('text\n')
    f.close()

python os.path模块学习

http://www.redicecn.com/html/Python/20110507/273.html

python 解析xml

https://docs.python.org/2/library/xml.etree.elementtree.html#module-xml.etree.ElementTree


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值