随笔分类 -  python

摘要:前言 最近在使用 python3 flask 做管理服务,需要实现服务中 flask server 和 另一个多线程while循环同时存在,如下 from flask import Flask , jsonify, request, abort,Response,send_file,render_t 阅读全文
posted @ 2023-12-28 17:00 BrianSun 阅读(367) 评论(0) 推荐(0) 编辑
摘要:前言 有一个flask项目a.py, 目录结构如下: |- a.py |- templates | - index.html |- static |- images 运行 python3 a.py可以正常加载网页,使用 pyinstaller 在 ubuntu16上打包: pyinstaller - 阅读全文
posted @ 2023-11-29 14:47 BrianSun 阅读(840) 评论(0) 推荐(0) 编辑
摘要:chatgpt给出的解决方案, 在json.dumps()函数调用中传入default参数来指定如何处理datetime对象 import json from datetime import datetime def datetime_handler(obj): if isinstance(obj, 阅读全文
posted @ 2023-11-16 12:45 BrianSun 阅读(71) 评论(0) 推荐(0) 编辑
摘要:正文 代码示例: #-*- coding:utf-8 -*- import requests url = "https://tst.com" res = requests.get(url=url, verify=False) print(res.content) 运行就报错: urllib3.exc 阅读全文
posted @ 2023-11-10 00:38 BrianSun 阅读(2091) 评论(0) 推荐(0) 编辑
摘要:python html转义与反转义 阅读全文
posted @ 2023-01-09 18:10 BrianSun 阅读(435) 评论(0) 推荐(0) 编辑
摘要:记一次win10 python -m http.server 启动后无法访问的经历 阅读全文
posted @ 2022-10-10 14:13 BrianSun 阅读(3834) 评论(0) 推荐(0) 编辑
摘要:ubuntu16 安装 python-networkmanager 失败 阅读全文
posted @ 2022-09-05 18:08 BrianSun 阅读(110) 评论(0) 推荐(0) 编辑
摘要:pysnmp 遍历设备 mibs 阅读全文
posted @ 2022-05-26 18:37 BrianSun 阅读(913) 评论(0) 推荐(0) 编辑
摘要:ubuntu20 python3 安装 easysnmp 阅读全文
posted @ 2022-04-14 16:32 BrianSun 阅读(361) 评论(0) 推荐(0) 编辑
摘要:python3 pip3 安装 xmlrpc 失败 阅读全文
posted @ 2022-03-24 10:19 BrianSun 阅读(452) 评论(0) 推荐(0) 编辑
摘要:pymsql往数据库插入表情报错 阅读全文
posted @ 2022-01-14 15:33 BrianSun 阅读(67) 评论(0) 推荐(0) 编辑
摘要:### 前言 众里寻他千百度,蓦然回首,那人却在灯火阑珊处。 最近要测试一个python2环境的代码,其中用到了MySQLdb, 查询网络,发现要安装mysql-python,于是就进行了一番艰难的探索,现在汇总记录一下,希望能过够为大家提供些许帮助。 ### 解决方案 本方案前提默认已经安装配置好 阅读全文
posted @ 2021-12-22 11:26 BrianSun 阅读(488) 评论(0) 推荐(0) 编辑
摘要:ubuntu 同时安装python2 和 python3 版本的 gunicorn 阅读全文
posted @ 2021-12-21 13:26 BrianSun 阅读(754) 评论(0) 推荐(0) 编辑
摘要:转: fastapi https 配置 阅读全文
posted @ 2021-12-08 15:01 BrianSun 阅读(2201) 评论(0) 推荐(0) 编辑
摘要:python3求取大文件sha1值和md5 阅读全文
posted @ 2021-11-04 14:51 BrianSun 阅读(798) 评论(0) 推荐(0) 编辑
摘要:详见 https://docs.python.org/zh-cn/3/library/struct.html#struct.pack 阅读全文
posted @ 2021-09-18 11:17 BrianSun 阅读(43) 评论(0) 推荐(0) 编辑
摘要:python实用总结 阅读全文
posted @ 2021-06-09 09:01 BrianSun 阅读(165) 评论(0) 推荐(0) 编辑
摘要:#ubuntu16.04 python2&3 pip升级后报错: #sys.stderr.write(f"ERROR: {exc}") *** ##描述 最近使用ubuntu16.04上的pip时提示升级,升级后报错: ``` Traceback (most recent call last): F 阅读全文
posted @ 2021-03-17 15:08 BrianSun 阅读(12161) 评论(2) 推荐(3) 编辑
摘要:pyinstaller适应python2和python3环境 阅读全文
posted @ 2021-02-20 18:23 BrianSun 阅读(1070) 评论(0) 推荐(0) 编辑
摘要:使用pip安装完需要的python库,运行脚本时报错:Syntax Error: Non-ASCII character '\xc3' in file /usr/local/lib/python2.7/dist-packages/rsa/key.py on line 1, but no encoding decleared; 阅读全文
posted @ 2020-09-01 11:23 BrianSun 阅读(1544) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示