2023年2月19日

props几种使用方法

摘要: 1.单向数据流传递 假设我们有一个父组件Parent和一个子组件Child,Parent中有一个message的数据需要传递给Child组件。在Parent组件中定义如下: <template> <div> <ChildComponent message="Hello, World!"/> </di 阅读全文
posted @ 2023-02-19 20:51 猪小气 阅读(176) 评论(0) 推荐(0) 编辑
2021年8月4日

网络编程-server端代码格式,可并发处理

摘要: server端代码格式 import time import socketserver class Myserver(socketserver.BaseRequestHandler): def handle(self): conn = self.request #***以下为服务器处理的内容*** 阅读全文
posted @ 2021-08-04 14:47 猪小气 阅读(41) 评论(0) 推荐(0) 编辑
2021年7月28日

TCP/UDP协议

摘要: tcp协议的多人多次通信 # 和一个人通信说多句话 # 和一个人聊完再和其他人聊 # socket() tcp协议的server # bind 绑定一个ip和端口 # listen 监听,代表socket服务的开启 # accept 等,到有客户端来访问和客户端建立连接 # send 直接通过连接发 阅读全文
posted @ 2021-07-28 22:29 猪小气 阅读(33) 评论(0) 推荐(0) 编辑
2021年7月5日

Logging 模块

摘要: Log信息等级划分:日志级别等级CRITICAL > ERROR > WARNING > INFO > DEBUG logging.debug('debug message') logging.info('info message') logging.warning('warning message 阅读全文
posted @ 2021-07-05 16:52 猪小气 阅读(25) 评论(0) 推荐(0) 编辑

shutil 模块,对文件的copy,删除,复制,压缩和解压

摘要: shutil 模块 拷贝文件 \# shutil.copy2('原文件', '现文件') 拷贝目录 # shutil.copytree("原目录", "新目录", ignore=shutil.ignore_patterns("*.pyc")) 删除目录 # shutil.rmtree("temp", 阅读全文
posted @ 2021-07-05 15:37 猪小气 阅读(197) 评论(0) 推荐(0) 编辑
2021年6月30日

hashlib 模块如何对文件进行加密生成MD5码

摘要: 使用sercr()函数对文件生成MD5码 import hashlib def sercr(data_path): with open(data_path,mode='rb') as f1: data = hashlib.md5() while True: data_read = f1.read(1 阅读全文
posted @ 2021-06-30 13:37 猪小气 阅读(128) 评论(0) 推荐(0) 编辑
2021年6月29日

from...import * 使用时需 配合__all__[ , , , ,]一起

摘要: from...import * 会讲模块中所有的变量都引用,很可能与文件中定义的变量和函数产生干扰而引发错误 为了防止该现象发生一般使用*时,会配合着all[]一起使用。 原文件中只会调用__all__[ , , , ,]里面的变量和函数。 使用__all__[ , , , ,]时,不会对impor 阅读全文
posted @ 2021-06-29 16:43 猪小气 阅读(70) 评论(0) 推荐(0) 编辑
2021年6月28日

时间模块学习

摘要: Time 模块 """ time模块 """ import time #获取时间戳 #时间戳:从时间元年(1970年1月1日 00:00:00) # print(time.time()) #获取的格式化时间对象:9个字段组成 # print(time.gmtime()) #GMT:格林尼治时间 # 阅读全文
posted @ 2021-06-28 07:29 猪小气 阅读(29) 评论(0) 推荐(0) 编辑
2021年6月26日

Python装饰器真心好用

摘要: 带万能参数、带返回值的装饰器 import time def timer_used(f): def inner(*args,**kwargs):#将参数聚合 startime = time.time() ret = f(*args,**kwargs)#参数打散 endtime = time.time 阅读全文
posted @ 2021-06-26 18:19 猪小气 阅读(51) 评论(2) 推荐(0) 编辑
2021年6月19日

Python数据类型

摘要: ![](https://img2020.cnblogs.com/blog/2418342/202106/2418342-20210619181247707-822129707.jpg) 阅读全文
posted @ 2021-06-19 18:13 猪小气 阅读(18) 评论(0) 推荐(0) 编辑