事件调度 sched模块内容很简单,只定义了一个类。它用来最为一个通用的事件调度模块。 class sched.scheduler(timefunc, delayfunc)这个类定义了调度事件的通用接口,它需要外部传入两个参数,timefunc是一个没有参数的返回时间类型数字的函数(常用使用的如time模块里面的time),delayfunc应该是一个需要一个参数来调用、与timefu
继承 json.JSONEncoder实现一个针对sqlalchemy返回类型的处理方式。sqlalchemy的返回类型有大都有两种,一种是Model对象,一种是Query集合(只查询部分字段)。针对这两种返回结果,都是来自同一中类型 sqlalchemy.orm.query.Query 所以针对Query做相应处理,让他返回一个dict c
class Exc{ int a; int b;}public class Except { @SuppressWarnings("finally") static int compute (){ Exc e = new Exc(); e.a = 10; e.b = 10; int res = 0 ; try{ res = e.a / e.b;