摘要: 概念: 进程: 1.创建进程: from multiprocessing import Process import os def func(m,n): print(m,n) print('获取子进程的pid:', os.getpid()) print('获取子进程的父进程pid:', os.get 阅读全文
posted @ 2019-04-05 14:23 Yzc_start 阅读(131) 评论(0) 推荐(0) 编辑
摘要: 数据表的创建: python manage.py makemigrations python manage.py migrate 后台管理注册: admin.site.register() 创建超级用户: python manage.py createsuperuser 增删改查操作 一对多(For 阅读全文
posted @ 2019-04-02 20:07 Yzc_start 阅读(142) 评论(0) 推荐(0) 编辑
摘要: 数据库基础知识 数据类型 创建数据表 表的约束(列举的约束条件都是针对表中字段进行限制,从而保证数据表中的正确性和唯一性) primary key 主键约束,用于唯一标识对应的记录 foreign key 外键约束 not null 非空约束 unique 唯一性约束 default 默认值约束 索 阅读全文
posted @ 2019-03-29 20:14 Yzc_start 阅读(221) 评论(0) 推荐(0) 编辑
摘要: 基于tcp协议的简单通话 server端 client端 基于udp的简单通话 server端 client端1 client端2 黏包现象 基于tcp的黏包现象,但不丢包 server端 client端 基于udp远程下发命令,不黏包,丢包不可靠 server端 client端 解决黏包问题(方法 阅读全文
posted @ 2019-03-26 09:24 Yzc_start 阅读(128) 评论(0) 推荐(0) 编辑
摘要: 装饰器函数 装饰器的主要功能:在不改变函数调用方式的基础上在函数的前、后添加功能。 装饰器的固定格式: 带参数的装饰器 多个装饰器装饰同一个函数 wrapper2 ,before funcwrapper1 ,before funcin fwrapper1 ,after funcwrapper2 ,a 阅读全文
posted @ 2019-03-22 20:40 Yzc_start 阅读(167) 评论(0) 推荐(0) 编辑
摘要: re模块 1 findall的优先级查询: 2 split的优先级查询 练习题: collections模块 1.namedtuple: 生成可以使用名字来访问元素内容的tuple 2.deque: 双端队列,可以快速的从另外一侧追加和推出对象 3.Counter: 计数器,主要用来计数 4.Ord 阅读全文
posted @ 2019-03-09 11:44 Yzc_start 阅读(161) 评论(0) 推荐(0) 编辑
摘要: 基础数据类型 1.整数类型 (int) 浮点数类型(float)long(长整型)注意:在Python3里不再有long类型了,全都是int 2.字符串数据类型(str) >>> name = "小黑" #字符串 >>> age = "20" #字符串 >>> age2 = 20 #int msg 阅读全文
posted @ 2019-03-07 14:19 Yzc_start 阅读(235) 评论(0) 推荐(0) 编辑