10 2021 档案
摘要:import random list = [20, 16, 10, 5]; random.shuffle(list) print "Reshuffled list : ", list; random.shuffle(list) print "Reshuffled list : ", list; 运行
阅读全文
摘要:from fastapi.staticfiles import StaticFiles app = FastAPI() # 挂载 app.mount("/static", StaticFiles(directory="static"), name="static") 安装 pip install a
阅读全文
摘要:or的使用(查找title为123或者是345) db.getCollection("news").find({ $or: [{ "title": "123" }, { "title": "345" }] }) 获取某些列(从news表中查找author为Staff Writer) db.news.
阅读全文
摘要:步骤: 1. 打开已有数据库表视图模型 2. 点击切换到e-r视图 3. 选中需要绘制e-r图的表格,右键选择逆向表到模型 4. 绘制连线 5. 导出
阅读全文
摘要:flask实现文件的上传 #flask实现文件上传 @app.route("/filetranslate", methods=['POST']) def filetranslate(): files = request.files["files"] print(files, 12901) print
阅读全文
摘要:@app.route("/filetranslate", methods=['POST']) def filetranslate(): files = request.files["files"] print(files, 12901) print(files.filename) file = "s
阅读全文
摘要:出现如下报错: 我自己遇到这个问题的解决方法是使用了如下命令解决的: pip install -U setuptools 更新了一下setuptools就ok了。这是再装python-docx的时候出现的问题. 来自于https://github.com/python-openxml/python-
阅读全文
摘要:curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py python get-pip.py --force-reinstall 验证是否装成功: pip show pip
阅读全文
摘要:这里用的是其他人的博客,卸载这里只是为了以后寻找方便。参考地址如下所示: https://www.jb51.net/article/199496.htm#_label1
阅读全文
摘要:出现错误: 或者 这种错误,有可能是stanza版本的问题(之前装了stanza==1.1.1和stanza==1.3.0版本),正常使用的时候,出现了上述的错误。 后面安装了 pip install stanza=1.2.3,上面说的两种错误都好了。
阅读全文
摘要:需引入"strconv"包 string到intint,err:=strconv.Atoi(string) string到int64int64, err := strconv.ParseInt(string, 10, 64) int到stringstring:=strconv.Itoa(int) i
阅读全文
摘要:1. 在终端中输入: sudo ufw disable 2. 输入密码 3. 出现如下提示: 防火墙关闭成功。
阅读全文
摘要:在工作用,用到了需要查找词的同义词的操作,使用python的nltk库中的wordnet来实现这个操作 1. 比如我们要寻找nice的同义词,可以使用如下代码实现需求: from nltk.corpus import wordnet# 第一次使用的时候,需要下载字典 import nltknltk.
阅读全文
摘要:1. 安装 argostranslate pip install argostranslate 2.到 这里 下载对应的模型(可能需要外网才能访问) 3. 编辑代码,进行翻译 def argo(): from argostranslate import package, translate pack
阅读全文
摘要:1. 从git上下载相应的依赖库,解压,并进入文件夹种 git clone https://github.com/argosopentech/argos-translate.git cd argos-translate 2. 创建python运行的虚拟环境 3. 使用如下命令进行安装 python
阅读全文