unix时间转换
import time
import datetime
unixtime = int(time.mktime(datetime.datetime.now().timetuple())) #获取当前unix时间
readable_time = datetime.datetime.fromtimestamp(unixtime) #unix时间转换成正常日期
13位unix时间
import time
current_milli_time = lambda: int(round(time.time() * 1000))
python读取大文件
with open(filename, 'rb') as f:
for line in f:
<do something with the line>
python html解码
import html
a="javascript:alert(1)"
html.unescape(a)
#'javascript:alert(1)'