python
thingjustthing
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
运行Python/flask的时候报错:[WinError 10013] 以一种访问权限不允许的方式做了一个访问套接字的尝试。
运行Python/flask的时候报错:[WinError 10013] 以一种访问权限不允许的方式做了一个访问套接字的尝试。经过查询发现这个问题的报错是因为接口被占用了导致所以需要查找一下被哪个程序占用了:1.找出占用的端口号:输入netstat -ano|findstr 5678查找后,发现被PID为:3936的程序占用,找到PID后可以通过任务管理器查看,然后关掉程序发现被APPache程序占用,关掉后即可再次运行也可以:找出端口号对应的服务器:tasklist if indstr原创 2021-08-09 10:32:40 · 12247 阅读 · 0 评论 -
Flask:本地文件,通过接口/ url 访问
@app.route("/static/<filename>")def get_filename(filename): with open(r'E:/xxxxx/static/{}'.format(filename),'rb') as f: fileas = f.read() resp = Response(fileas,mimetype='application/octet-stream')if __name__ == "__main__"...原创 2021-06-30 17:49:13 · 3094 阅读 · 0 评论 -
Flask配置定时任务
from flask_apscheduler import APSchedulerclass Config(object): JOBS=[ { 'id':'job', 'func':'__main__:job', // 需要执行的函数job 'trigger':'cron', // corn 是执行定时任务的触发器类型 'hour':9, .原创 2021-06-29 20:00:19 · 2211 阅读 · 0 评论 -
终于解决了 Python 多个字段多个参数的查询
def selectby(self,sql,*args): self.cursor = self.db.cursor() try: self.cursor.execute(sql,args) tt=self.cursor.execute(sql,args) data = self.cursor.fetchall() return data except:..原创 2021-04-12 17:28:53 · 983 阅读 · 0 评论 -
最新Chromedriver下载地址
http://chromedriver.storage.googleapis.com/index.html原创 2021-03-18 10:30:21 · 617 阅读 · 0 评论 -
pytest探索
https://www.cnblogs.com/linuxchao/p/linuxchao-pytest-Actual.html(关注po模式)https://blog.youkuaiyun.com/weixin_39080072/article/details/90599949(关注init_driver的写法)原创 2020-04-23 15:02:07 · 207 阅读 · 0 评论 -
unitest入门2
写txt测试报告需求:每个case的执行结果写入txt实现:1、定义一个函数,在需要写入的地方直接调用def writeresult(self,text): with open('unitestreport.txt', 'a') as f: f.write(text) f.close()可以写入txt,但是会发生截断:原:{'id...原创 2020-04-16 11:10:41 · 221 阅读 · 0 评论 -
unitest入门
https://blog.youkuaiyun.com/qq_27275447/article/details/80270270https://blog.youkuaiyun.com/m0_38034387/article/details/80566528unittest中最核心的四个概念是:test case, test suite, test runner, test fixture。TestCase ...原创 2020-04-14 16:47:44 · 545 阅读 · 0 评论 -
python3 学习记录
1、input printinput():获取的值是一个字符,需转换成自己需要的类型float(input('please input a :')) int((input('please input a :')) 等print():如果需要参数话 需写成 print('sum= %.1f' %sum) 后面的参数要加%号!!!2、平方根:(1)math.sqrt (...原创 2020-03-26 22:19:17 · 174 阅读 · 0 评论
分享