随笔分类 - python
摘要:前言 最近在使用 python3 flask 做管理服务,需要实现服务中 flask server 和 另一个多线程while循环同时存在,如下 from flask import Flask , jsonify, request, abort,Response,send_file,render_t
阅读全文
摘要:前言 有一个flask项目a.py, 目录结构如下: |- a.py |- templates | - index.html |- static |- images 运行 python3 a.py可以正常加载网页,使用 pyinstaller 在 ubuntu16上打包: pyinstaller -
阅读全文
摘要:chatgpt给出的解决方案, 在json.dumps()函数调用中传入default参数来指定如何处理datetime对象 import json from datetime import datetime def datetime_handler(obj): if isinstance(obj,
阅读全文
摘要:正文 代码示例: #-*- coding:utf-8 -*- import requests url = "https://tst.com" res = requests.get(url=url, verify=False) print(res.content) 运行就报错: urllib3.exc
阅读全文
摘要:python html转义与反转义
阅读全文
摘要:记一次win10 python -m http.server 启动后无法访问的经历
阅读全文
摘要:ubuntu16 安装 python-networkmanager 失败
阅读全文
摘要:ubuntu20 python3 安装 easysnmp
阅读全文
摘要:python3 pip3 安装 xmlrpc 失败
阅读全文
摘要:### 前言 众里寻他千百度,蓦然回首,那人却在灯火阑珊处。 最近要测试一个python2环境的代码,其中用到了MySQLdb, 查询网络,发现要安装mysql-python,于是就进行了一番艰难的探索,现在汇总记录一下,希望能过够为大家提供些许帮助。 ### 解决方案 本方案前提默认已经安装配置好
阅读全文
摘要:ubuntu 同时安装python2 和 python3 版本的 gunicorn
阅读全文
摘要:转: fastapi https 配置
阅读全文
摘要:python3求取大文件sha1值和md5
阅读全文
摘要:详见 https://docs.python.org/zh-cn/3/library/struct.html#struct.pack
阅读全文
摘要:#ubuntu16.04 python2&3 pip升级后报错: #sys.stderr.write(f"ERROR: {exc}") *** ##描述 最近使用ubuntu16.04上的pip时提示升级,升级后报错: ``` Traceback (most recent call last): F
阅读全文
摘要:pyinstaller适应python2和python3环境
阅读全文
摘要:使用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;
阅读全文