会员
众包
新闻
博问
闪存
赞助商
HarmonyOS
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
王思磊
博客园
首页
新随笔
联系
订阅
管理
2024年1月28日
快速开始drf
摘要: 什么是drf drf是基于django开发的组件,他的本质是django的一个app。drf可以帮助我们快速开发一套遵循restful规范的程序。 安装drf 首先需要安装django pip install django 再次安装drf pip install djangorestframewor
阅读全文
posted @ 2024-01-28 20:37 王思磊
阅读(39)
评论(0)
推荐(0)
2018年4月5日
yagmail模块的使用
摘要: import yagmail# 链接邮箱服务器yag = yagmail.SMTP(user="xxxxxx@126.com", password="xxxxxx", host='smtp.126.com')# 邮箱正文contents = ['This is the body, and here
阅读全文
posted @ 2018-04-05 13:49 王思磊
阅读(248)
评论(0)
推荐(0)
2018年3月15日
python--接口自动化
摘要: 日志文件
阅读全文
posted @ 2018-03-15 10:32 王思磊
阅读(206)
评论(0)
推荐(0)
Python--日志模块
摘要: # 时间 哪个文件里面的 第几行代码import loggingfrom logging import handlers# logging.debug('debug级别,最低级别,一般开发人员用来打印一些调试信息')# logging.info('info级别,正常输出信息,一般用来打印一些正常的操
阅读全文
posted @ 2018-03-15 10:21 王思磊
阅读(130)
评论(0)
推荐(0)
Python--unittest参数化
摘要: # file_to_list import osimport xlrdimport jsonclass DataToParam(object): @classmethod def text(cls, file_name, seq=','): cls.file_exist(file_name) wit
阅读全文
posted @ 2018-03-15 10:21 王思磊
阅读(178)
评论(0)
推荐(0)
Python--线程池
摘要: # 放线程的一个池子import threadpool def say(num): print(num) res = list(range(101)) pool = threadpool.ThreadPool(10) # 创建一个线程池 reqs = threadpool.makeRequests(
阅读全文
posted @ 2018-03-15 10:16 王思磊
阅读(952)
评论(0)
推荐(0)
2018年3月7日
Python--小笔记
摘要: 上周回顾 异常处理 try xxx except IndexError as e: print() except Exception as e: print() else: print('没有出现异常!') finally: pass 面向对象 类 模型 实例 根据这个模型造出来的东西 实例化 造东
阅读全文
posted @ 2018-03-07 15:24 王思磊
阅读(142)
评论(0)
推荐(0)
Python--守护线程
摘要: import threadingimport timedef pz(): time.sleep(2) print('A是秦始皇的陪葬')for i in range(10): t = threading.Thread(target=pz) # 设置子线程为守护线程,守护线程就是一旦主线程执行结束,子
阅读全文
posted @ 2018-03-07 15:20 王思磊
阅读(146)
评论(0)
推荐(0)
Python--多线程获取返回值
摘要: import threading# 如果多线程想获取到结果的话,那么就得把它的结果写到一个list里面res = []def lida(x, y): res.append(x + y)for i in range(5): t = threading.Thread(target=lida, args=
阅读全文
posted @ 2018-03-07 15:19 王思磊
阅读(228)
评论(0)
推荐(0)
Python--多进程
摘要: # 想利用多核cpu,那么就使用多进程import multiprocessingimport timeimport threadingdef run2(): print('这是多线程启动的')def run(): time.sleep(2) print('多进程') for j in range(
阅读全文
posted @ 2018-03-07 15:19 王思磊
阅读(100)
评论(0)
推荐(0)
下一页
公告