摘要:
1.dd命令 生成一个1000M的test文件,文件内容为全0(因从/dev/zero中读取,/dev/zero为0源)。但是这样为实际写入硬盘,文件产生速度取决于硬盘读写速度,如果想要产生超大文件,速度很慢 dd if=/dev/zero of=test1 bs=1M count=1000 在某种 阅读全文
摘要:
场景描述 关于产品的排序,需要根据汉字或者不规则顺序和多个字段进行排序 打个比喻:(status==1,modify_user==None,status==3,status==2) 解决办法 使用case来解决。 from sqlalchemy import case query.order_by( 阅读全文
摘要:
class ShowError(Exception): def __init__(self, message): self.message = message def __str__(self): return self.message def A(): raise ShowError("666") 阅读全文
摘要:
安装 win32com 模块。 pip install pypiwin32 代码 t1.py from win32com import client as wc import os word = wc.Dispatch('Word.Application') def wordsToHtml(dir) 阅读全文
摘要:
【注】 linux环境必须安装 python 获取supervisor包 获取地址:https://pypi.python.org/pypi/supervisor 下载后 解压supervisor-3.3.1.tar.gz 并安装 # tar zxvf supervisor-3.3.1.tar.gz 阅读全文
摘要:
查看firewalld防火墙状态 # systemctl status firewalld active(runing)代表运行 关闭firewalld防火墙,禁止开机启动 # systemctl stop firewalld && systemctl disable firewalld 检查fir 阅读全文
摘要:
准备 我们需要提前准备两个包,分别是 flask-sqlacodegen 和 psycopg2 安装方式为 pip install flask-sqlacodegen pip install psycopg2 开始 我们直接使用命令开始生成 # 单张表 flask-sqlacodegen "post 阅读全文
摘要:
介绍 使用库 requests # 抓取诗词 pyautogui # 抓取鼠标位置 pyperclip # 复制内容 代码 # coding=utf-8 import time import os import requests import pyautogui as pag import pype 阅读全文
摘要:
简介 RedisJSON 是一种高性能 JSON 文档存储,允许开发人员构建现代应用程序。它在内存中存储和处理 JSON,以亚毫秒级支持每秒数百万次操作响应时间。 JSON 文档的原生索引、查询和全文搜索允许开发人员创建二级索引,快速查询数据。 Docker安装 拉取rejson Docker pu 阅读全文
摘要:
【Python压缩文件夹】导入“zipfile”模块 import zipfile import os def zip_ya(startdir, file_news): z = zipfile.ZipFile(file_news, 'w', zipfile.ZIP_DEFLATED) for dir 阅读全文