def main(): print('======老师登录======') teacher = commons.login(models.Teacher.db_path) choices = [{ 'name': '查看班级信息', 'method': class_info, 'args': teacher }, { 'name': '查看学生信息', 'method': student_info, 'args': teacher }, { 'name': '设置学生分数', 'method': set_student_score, 'args': teacher }] commons.to_choices_args(choices, True)
def login(): return commons.login(Admin.db_path)
def login(): return commons.login(Student.db_path)
def login(): return commons.login(Teacher.db_path)
# # logger = logging.getLogger('TEST-LOG') # 标记,获取loger对象 # # logger.setLevel(logging.DEBUG) # 设置日志的级别 # # # # ch = logging.StreamHandler() # # ch.setLevel(logging.DEBUG) # # # # fh = logging.FileHandler("access.log") # # fh.setLevel(logging.WARNING) # # # # formatter = logging.Formatter('%(asctime)s - %(name)s - %(levelname)s - %(message)s') # # formatter_fh = logging.Formatter('%(asctime)s - %(filename)s -%(lineno)d - %(levelname)s - %(message)s') # # # # ch.setFormatter(formatter) # 将format注册给handle # # fh.setFormatter(formatter_fh) # # logger.addHandler(ch) # 将handle注册给logger # # logger.addHandler(fh) # # # # logger.debug('debug message' ) # # logger.info('info message') # # logger.warn('warn message') # # logger.error('error message') # # logger.critical('critical message') # # print(__name__) # way1 from lib import commons as aa aa.login()