上一页 1 2 3 4 5 6 7 8 ··· 12 下一页
摘要: Auth认证系统 from django.contrib.auth import login, logout, authenticate from django.contrib.auth.models import User # 用户登陆 user = authenticate(username, 阅读全文
posted @ 2020-07-31 11:28 呓语i 阅读(454) 评论(0) 推荐(0) 编辑
摘要: import shutil # 复制文件 shutil.copy(src, dst, *, follow_symlinks=True) # 将以 src 为根起点的整个目录树拷贝到名为 dst 的目录并返回目标目录。 shutil.copytree(src, dst, symlinks=False, 阅读全文
posted @ 2020-07-30 17:39 呓语i 阅读(137) 评论(0) 推荐(0) 编辑
摘要: import zipfile # 打开一个 ZIP 文件,file 为一个指向文件的路径(字符串) class zipfile.ZipFile(file, mode='r', compression=ZIP_STORED, allowZip64=True, compresslevel=None, * 阅读全文
posted @ 2020-07-30 17:37 呓语i 阅读(334) 评论(0) 推荐(0) 编辑
摘要: 常见的启动方式 scrapy crawl spider_name 官方提供的启动方式 使用脚本启动 import scrapy from scrapy.crawler import CrawlerProcess class MySpider(scrapy.Spider): # Your spider 阅读全文
posted @ 2020-07-06 20:57 呓语i 阅读(283) 评论(0) 推荐(1) 编辑
摘要: from datetime import datetime, date from bson import ObjectId def dump(o): """ Json格式化方法 :param o: :return: """ if isinstance(o, ObjectId): return str 阅读全文
posted @ 2020-07-06 19:35 呓语i 阅读(513) 评论(0) 推荐(0) 编辑
摘要: pip install openpyxl 1. 读取文件 import openpyxl # 加载文件 wb = openpyxl.load_workbook("example.xlsx") # 获取所有单元簿的名称 wb.get_sheet_names() # 获取单元簿 sheet = wb.g 阅读全文
posted @ 2020-07-02 23:49 呓语i 阅读(561) 评论(0) 推荐(0) 编辑
摘要: 查看日志 # 查看docker容器的IP docker inspect --format='{{.Name}} - {{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' $(docker ps -aq) # 查看 2020-01-01 之 阅读全文
posted @ 2020-06-29 20:12 呓语i 阅读(88) 评论(0) 推荐(0) 编辑
摘要: pwgen sudo yum install pwgen # 生成160个随机密码 pwgen # 生成安全的随机密码 pwgen -s # 生成5个14个字符长度安全的随机密码 pwgen -s 14 5 # 生成超强度随机密码 pwgen -cnys 10 10 openssl # 生成一个14 阅读全文
posted @ 2020-06-29 20:10 呓语i 阅读(183) 评论(0) 推荐(0) 编辑
摘要: 执行Lua脚本 lua hello.lua 运行完指定脚本后进入交互式程序 lua -i hello.lua 在解释器中加载指定脚本 dofile("hello.lua") 直接在命令行运行代码 lua -e "print(math.sin(12))" 加载脚本 lua -l hello.lua - 阅读全文
posted @ 2020-06-23 23:18 呓语i 阅读(128) 评论(0) 推荐(0) 编辑
摘要: 查看防火墙状态 firewall-cmd --state 停止防火墙 systemctl stop firewalld.service 禁止开机启动 systemctl disable firewalld.service 阅读全文
posted @ 2020-06-17 21:19 呓语i 阅读(176) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 7 8 ··· 12 下一页