文章分类 - 作业
摘要:SQL查询练习 6、 查询姓李老师的个数 ~~~mysql SELECT count( tid ) FROM teacher WHERE tname LIKE '李%' ~~~ 8、 查询物理课程比生物课程高的学生的学号 ~~~mysql SELECT t1.student_id FROM ( SE
阅读全文
posted @ 2020-05-08 19:08
the3times
摘要:2.完成下列分组查询练习题(以课上建表代码为参考) 1. 查询岗位名以及岗位包含的所有员工名字 select post as '岗位', group_concat(name) as '员工' from emp group by pos t; 2. 查询岗位名以及各岗位内包含的员工个数 select
阅读全文
posted @ 2020-05-06 15:28
the3times
摘要:用户表 用户组表 主机表 业务线表 建关系:user usergroup(多对多) 建关系:host business(多对多) 建关系:user host (多对多) 作业2: 班级表 ~~~python create table class( cid int primary key auto_i
阅读全文
posted @ 2020-05-05 17:23
the3times
摘要:简述操作系统发展史 ~~~python 第一代:穿孔卡片:手工+顺序执行程序 第二代:晶体管和批处理:手工+顺行执行程序,批处理的形式 第三代:电子管和多道技术:单核cpu+多道技术实现了并发效果 第四代:个人计算机PC ~~~ 简述进程发展史及算法演变 ~~~python 进程调度算法演变: 先来
阅读全文
posted @ 2020-04-22 21:42
the3times
摘要:项目结构 ~~~python 我的作业/ | data_server 服务端文件夹 | data client 客户端文件夹 | server.py 服务端程序 | client.py 客户度程序 ~~~ server.py ~~~python import os, json, struct imp
阅读全文
posted @ 2020-04-21 20:46
the3times
摘要:作业20200420 编写远程执行命令的CS架构软件 ~~~python 服务端 import socket import subprocess ip_port = ('127.0.0.1', 8080) server = socket.socket(socket.AF_INET, socket.S
阅读全文
posted @ 2020-04-20 15:54
the3times
摘要:1、在元类中控制把自定义类的数据属性都变成大写 ~~~python class Mymetaclass(type): def __new__(cls,name,bases,attrs): update_attrs={} for k,v in attrs.items(): if not callabl
阅读全文
posted @ 2020-04-15 21:31
the3times
摘要:题目1:菱形问题的属性查找顺序 ~~~python python多继承菱形结构继承 经典类: 深度优先,一个分支找到尽头再从另一个分支开始查找 新式类 广度优先,一个分支不找到尽头,就开始另一个分支,等到最后一个分支再找尽头,最后再找object ~~~ 作业2 ~~~python import p
阅读全文
posted @ 2020-04-09 20:40
the3times
摘要:2、基于上课作业讲解的面向对象代码,扩写Student类 3、加入序列化与反序列化操作 4、对象之间的关联采用id号 5、可以通过id找到对应的文件,然后从文件中反序列化出执行的学校、班级、课程、学生对象 ~~~python import pickle import uuid class Schoo
阅读全文
posted @ 2020-04-08 18:16
the3times
摘要:先定义5个类,然后再实例化对象。实例化后,对象们自由组队玩耍就实现了整个项目需求。 ~~~python 选课系统项目中涉及到诸多数据与功能,要求引入面向对象的思想对其进行高度整合 1、学校数据与功能整合 2、课程数据与功能进行整合 3、学生数据与功能进行整合 4、讲师数据与功能进行整合 5、班级数据
阅读全文
posted @ 2020-04-07 17:22
the3times
摘要:将loggin日志记录模块应用到项目中 lib/tools.py ~~~python def save_log(logger, log_type, msg): """ 保存用户日志的函数,封装了logging模块的写日志方法 :param logger: 日志器 :param log_type: 日
阅读全文
posted @ 2020-04-01 21:53
the3times
摘要:1、把登录与注册的密码都换成密文形式 ~~~python login.py from lib.tools import hash_md5 from interface.interface import login_interface def login(): print('这是登录界面'.cente
阅读全文
posted @ 2020-03-31 20:18
the3times
摘要:1、检索文件夹大小的程序,要求执行方式如下 python3.8 run.py 文件夹 run.py ~~~python import os import sys def get_size(dir): items = os.listdir(dir) for item in items: item =
阅读全文
posted @ 2020-03-30 21:33
the3times
摘要:需求 ~~~python 编写小说阅读程序实现下属功能 一:程序运行开始时显示 0 账号注册 1 充值功能 2 阅读小说 二: 针对文件db.txt,内容格式为:"用户名:密码:金额",完成下述功能 2.1、账号注册 2.2、充值功能 三:文件story_class.txt存放类别与小说文件路径,如
阅读全文
posted @ 2020-03-29 15:55
the3times
摘要:1、文件内容如下,标题为:姓名,性别,年纪,薪资 egon male 18 3000 alex male 38 30000 wupeiqi female 28 20000 yuanhao female 28 10000 要求: 从文件中取出每一条记录放入列表中, 列表的每个元素都是{'name':'
阅读全文
posted @ 2020-03-26 17:36
the3times
摘要:1、文件内容如下,标题为:姓名,性别,年纪,薪资 egon male 18 3000 alex male 38 30000 wupeiqi female 28 20000 yuanhao female 28 10000 要求: 从文件中取出每一条记录放入列表中, 列表的每个元素都是{'name':'
阅读全文
posted @ 2020-03-25 18:38
the3times
摘要:1、编写课上讲解的有参装饰器 ~~~python def auth(db_type): def wrapper(func): def inner( args, kwargs): name = input('name : ').strip() pwd = input('pwd : ').strip()
阅读全文
posted @ 2020-03-24 18:42
the3times
摘要:一:编写函数,(函数执行的时间用time.sleep(n)模拟) 二:编写装饰器,为函数加上统计时间的功能 三:编写装饰器,为函数加上认证的功能 ~~~python import time def timer(func): def wrapper( args, kwargs): start = ti
阅读全文
posted @ 2020-03-23 18:13
the3times
摘要:1、函数对象优化多分支if的代码练熟 ~~~python def login(): print('this is login') def logout(): print('this is logout') def register(): print('this is register') cdm_d
阅读全文
posted @ 2020-03-20 17:47
the3times

浙公网安备 33010602011771号