>>> import datetime
>>> now = datetime.datetime.now()
>>> now
datetime.datetime(2012, 2, 14, 16, 24, 36, 171000)
>>> dir(now)
发现取得时间方法是now.year的方式。
>>> now2 = datetime.datetime.now()
>>> dd=now2-now
>>> dd
datetime.timedelta(0, 209, 938000)
>>> dir(dd)
>>> dd.days
0
>>> dd.microseconds
938000
>>> dd.seconds
209
MD5加密方法:
>>> import md5
>>> v = md5.new('uuuuu').hexdigest()
>>> v
'3c9aa281ced92294f259c0c55520b2cf'
>>> b= md5.new('uuuuu').hexdigest()[16:]
>>> b
'f259c0c55520b2cf'
上一篇: django建站之SMTP发送邮件
下一篇: ubuntu Apache+mod_wsgi错误提示
0 Responses so far.