摘要: 注:本博文主要为转载后根据本人情况再加工 1 问题: python3.7.2安装遇到如下ssl问题 >>> import ssl Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/usr/loc 阅读全文
posted @ 2020-02-26 16:28 风云_就是她了 阅读(4450) 评论(0) 推荐(0) 编辑
摘要: 一、创建文档索引 1、语法格式 PUT /{index}/{type}/{id} { "field": "value", ... } _index:文档存放在哪里 _type:文档表示的对象类别 _id:文档唯一标识 2、示例 PUT /website/blog/123 { "title": "My 阅读全文
posted @ 2020-02-13 07:59 风云_就是她了 阅读(375) 评论(0) 推荐(0) 编辑
摘要: 在某宝给小朋友买了个电子琴学习光盘,想放到ipad播放,但光盘上的文件为dat格式,需转为mpg格式,以下为转换代码(其实就是重命名文件): 1 #encoding=utf-8 2 """ 3 将VCD的DAT文件命令为mpg文件 4 """ 5 import os 6 path = r"E:\家庭 阅读全文
posted @ 2020-01-29 19:48 风云_就是她了 阅读(602) 评论(0) 推荐(0) 编辑
摘要: 如下程序模拟队列先进先出(FIFO)的特性: 代码: class Queue: def __init__(self): self.__data = [] def push(self,value): self.__data.append(value) def get(self): if self.__ 阅读全文
posted @ 2020-01-29 17:11 风云_就是她了 阅读(240) 评论(0) 推荐(0) 编辑
摘要: 线程示例: import threading import time # 唱歌任务 def sing(): # 扩展: 获取当前线程 # print("sing当前执行的线程为:", threading.current_thread()) for i in range(5): print("正在唱歌 阅读全文
posted @ 2020-01-28 18:20 风云_就是她了 阅读(205) 评论(0) 推荐(0) 编辑
摘要: 装饰器器的出现主要是为了在不修改原函数的前提下对被装饰函数添加一些额外功能(如打印日志,权限验证等),利用的python原理,就是一切兼对象,函数也可以作为参数进行传递。 #!/usr/bin/env python import time def demo(myfunc): def wraper() 阅读全文
posted @ 2020-01-26 17:59 风云_就是她了 阅读(208) 评论(0) 推荐(0) 编辑
摘要: 一些KIBANA的操作,记录下,免下次重复写 #创建索引名为kb_question的索引,并添加mapping,即各字段属性 PUT kb_question { "mappings": { "kb_question": { "properties": { "content": { "type": " 阅读全文
posted @ 2020-01-22 11:21 风云_就是她了 阅读(302) 评论(0) 推荐(0) 编辑
摘要: 1)安装git,略 $ git config --global user.name "Your Name" $ git config --global user.email "email@example.com" 3)选择合适地方,创建空目录 $ mkdir test //创建空目录,目录名字为te 阅读全文
posted @ 2020-01-20 20:40 风云_就是她了 阅读(190) 评论(0) 推荐(0) 编辑
摘要: 了解了一下python对es 7.5的操作,记录下,不难: #!/usr/bin/env python # -*- coding: UTF-8 -*- from settings import Config mapping = { 'properties': { 'topic': { 'type': 阅读全文
posted @ 2020-01-20 10:48 风云_就是她了 阅读(435) 评论(0) 推荐(0) 编辑
摘要: 数据库的连接池建议放在类似settings.py的配置模块中,因为基本都是配置项,方便统一管理。 1) 连接池类#settings.py import os from DBUtils.PooledDB import PooledDB from elasticsearch import Elastic 阅读全文
posted @ 2020-01-18 10:00 风云_就是她了 阅读(736) 评论(0) 推荐(0) 编辑