会员
众包
新闻
博问
闪存
赞助商
HarmonyOS
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
呓语
博客园
首页
新随笔
联系
订阅
管理
上一页
1
2
3
4
5
6
7
8
···
12
下一页
2020年7月31日
python Django 用户管理和权限认证
摘要: 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
阅读(506)
评论(0)
推荐(0)
2020年7月30日
python shutil 文件操作
摘要: import shutil # 复制文件 shutil.copy(src, dst, *, follow_symlinks=True) # 将以 src 为根起点的整个目录树拷贝到名为 dst 的目录并返回目标目录。 shutil.copytree(src, dst, symlinks=False,
阅读全文
posted @ 2020-07-30 17:39 呓语i
阅读(141)
评论(0)
推荐(0)
python zip 压缩文件
摘要: import zipfile # 打开一个 ZIP 文件,file 为一个指向文件的路径(字符串) class zipfile.ZipFile(file, mode='r', compression=ZIP_STORED, allowZip64=True, compresslevel=None, *
阅读全文
posted @ 2020-07-30 17:37 呓语i
阅读(343)
评论(0)
推荐(0)
2020年7月6日
scrapy 启动多个爬虫
摘要: 常见的启动方式 scrapy crawl spider_name 官方提供的启动方式 使用脚本启动 import scrapy from scrapy.crawler import CrawlerProcess class MySpider(scrapy.Spider): # Your spider
阅读全文
posted @ 2020-07-06 20:57 呓语i
阅读(297)
评论(0)
推荐(1)
python json时间格式化
摘要: 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
阅读(525)
评论(0)
推荐(0)
2020年7月2日
python openpyxl 操作文件
摘要: 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
阅读(584)
评论(0)
推荐(0)
2020年6月29日
docker 容器命令
摘要: 查看日志 # 查看docker容器的IP docker inspect --format='{{.Name}} - {{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' $(docker ps -aq) # 查看 2020-01-01 之
阅读全文
posted @ 2020-06-29 20:12 呓语i
阅读(89)
评论(0)
推荐(0)
Linux生成随机密码
摘要: 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
阅读(194)
评论(0)
推荐(0)
2020年6月23日
Lua 基础学习笔记
摘要: 执行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
阅读(135)
评论(0)
推荐(0)
2020年6月17日
Centos7 关闭防火墙
摘要: 查看防火墙状态 firewall-cmd --state 停止防火墙 systemctl stop firewalld.service 禁止开机启动 systemctl disable firewalld.service
阅读全文
posted @ 2020-06-17 21:19 呓语i
阅读(178)
评论(0)
推荐(0)
上一页
1
2
3
4
5
6
7
8
···
12
下一页
公告