![](https://img-blog.csdnimg.cn/20201014180756922.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
python
woobol
非主流业余码农
展开
-
python-TypeError: Object of type ‘datetime‘ is not JSON serializable 报错
class CJsonEncoder(json.JSONEncoder): def default(self, obj): if isinstance(obj, datetime.datetime): return obj.strftime('%Y-%m-%d %H:%M:%S') elif isinstance(obj, date)...原创 2019-04-22 09:55:02 · 12450 阅读 · 0 评论 -
python-TypeError: Object of type ‘Decimal‘ is not JSON serializable 报错
class DecimalEncoder(json.JSONEncoder): def default(self, o): if isinstance(o, decimal.Decimal): return float(o) super(DecimalEncoder, self).default(o)j = json.dum...原创 2019-04-22 10:04:33 · 19526 阅读 · 2 评论 -
python实现截取屏幕保存文件,删除N天前截图
from PIL import ImageGrabimport timeimport scheduleimport osimport shutilimport datetimedays = -3# 截屏def savepic(): im = ImageGrab.grab() now = time.strftime("%Y_%m_%d_%H_%M_%S", time.loc...原创 2019-04-15 14:21:18 · 28659 阅读 · 1 评论 -
windows倒计时锁屏-python
# 倒计时锁屏import timefrom ctypes import *def closewindows(closetime): while closetime>0: print(closetime) time.sleep(1) closetime-=1 user32 = windll.LoadLibrary('us...原创 2019-04-15 14:29:51 · 19413 阅读 · 1 评论