
python
__浩
这个作者很懒,什么都没留下…
展开
-
No matching distribution found for anyjson>=0.3.3
python3安装依赖时报错ERROR: Could not find a version that satisfies the requirement anyjson>=0.3.3 (from kombu) (from versions: 0.1, 0.2.0, 0.2.1, 0.2.2, 0.2.3, 0.2.4, 0.2.5, 0.3, 0.3.1, 0.3.2, 0.3.3)ERROR: No matching distribution found for anyjson>=0.3.原创 2021-10-28 14:52:55 · 3069 阅读 · 0 评论 -
python 上传文件并保存
获取前端上传文件,生成唯一ID,保存本地引入uuidimport uuid从request对象里获取文件f = request.FILES.get('file')3.打开本地file目录,并写入 with open('files/' + uname + '.xls', 'wb+') as destination: for chunk in f.chunks(): destination.write(chunk)以下是完整代码def原创 2021-06-28 15:20:44 · 1939 阅读 · 0 评论 -
linux系统python md文件转pdf
linux md文件转pdf1.使用python依赖pypandoc,将md文本转成doc文件import pypandoc //引入pypandoc依赖""":param text: 数据源文本:param outputfile: 生成文件路径"""pypandoc.convert_text(text, 'docx', 'md', outputfile= outputPath + '.docx')2.使用LibreOffice软件,将doc文件转成pdf首先卸载当前系统的libre原创 2021-05-06 16:49:02 · 939 阅读 · 0 评论 -
项目中实现在线预览office文件
最近项目中需要前端页面预览office文件,word、excel、ppt,现有如下几种解决办法,包括前端后端1.使用微软提供的office在线预览,提供下载,打印pdf等功能,无法自定义。使用方法http://view.officeapps.live.com/op/view.aspx?src=$url(url为文件所在地址URL,需要部署在线上,可以访问的URL,IRL路径必须通过URL编码)...原创 2020-04-26 18:06:25 · 3733 阅读 · 0 评论 -
pip安装时setuptools报错解决
ERROR: Command errored out with exit status 1: command: 'd:\git_honops\preparations\venv\scripts\python.exe' -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\Lenovo\\AppDat...原创 2020-04-26 17:23:39 · 4473 阅读 · 0 评论