摘要: 1. python3 多线程 # 主线程只负责生成工作线程 # 工作线程只做具体的工作 # 多线程共享进程里的内存块 # 多进程不共享 import threading def Hello(world, tedu): print('Hello %s %s!' % (world,tedu)) if _ 阅读全文
posted @ 2023-12-25 14:50 江戸川のコナン 阅读(45) 评论(0) 推荐(0) 编辑
摘要: 1. https://ipapi.co (每月免费查询3W条) 支持返回 json, jsonp, xml, csv,yaml 工具API文档:https://ipapi.co/api/#specific-location-field价格: 具体使用: get 方式请求: https://ipapi 阅读全文
posted @ 2023-06-13 11:45 江戸川のコナン 阅读(786) 评论(0) 推荐(0) 编辑
摘要: #!/usr/bin/env python # -*- coding: utf-8 -*- import calendar from datetime import datetime from dateutil.relativedelta import relativedelta # 获取当前月 d 阅读全文
posted @ 2023-06-07 10:43 江戸川のコナン 阅读(709) 评论(0) 推荐(0) 编辑
摘要: import time def time_conversion(times): # 转换成新的时间格式(2016-05-05 20:28:54) dt = time.strftime("%Y-%m-%d %H:%M:%S", time.localtime(times)) print(dt) def 阅读全文
posted @ 2023-02-09 12:39 江戸川のコナン 阅读(14) 评论(0) 推荐(0) 编辑
摘要: 计算网站SSL证书距离当前还有多少天过期 配合 config.py 以列表的形式传输需要检测域名到脚本中 1. 检测脚本 # -*- coding: utf-8 -*-"""1. 此脚本为检测域名的SSL证书过期时间,距离当前时间还有多久。2. 此脚本需要配合 config.py 使用,config 阅读全文
posted @ 2022-11-08 19:14 江戸川のコナン 阅读(656) 评论(3) 推荐(0) 编辑
摘要: 网页采用超文本标记预研HTML编写 第一个html,标题: <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>HTML 学习</title> </head> <body> 这是我的第一个网页 </body> < 阅读全文
posted @ 2022-04-22 18:43 江戸川のコナン 阅读(26) 评论(0) 推荐(0) 编辑
摘要: 命名元组:和普通元组一样,有相同的表现特征,但是其添加的功能就是可以根据名称引用元组中的项。 collections模块提供了namedtuple()函数,用于创建自定义的元组数据类型 from collections import namedtuple user1 = ("bob", 22, "b 阅读全文
posted @ 2022-04-14 18:26 江戸川のコナン 阅读(33) 评论(0) 推荐(0) 编辑
摘要: 1. 安装ansible # yum install -y ansible 2. 创建hosts文件,将所有需要被管理的主机的IP地址都写到文件中 vim /etc/ansible/hosts [all] 192.168.8.157 192.168.8.159 3. 使用ansible-keysca 阅读全文
posted @ 2022-04-07 18:18 江戸川のコナン 阅读(340) 评论(0) 推荐(0) 编辑
摘要: SFTP简介 sftp是一种安全的文件传送协议,是ssh内含协议,也就是说只要sshd服务器启动了,sftp就可使用,不需要额外安装,它的默认端口和SSH一样为22。 FTP和SFTP的区别 1.链接方式:FTP使用TCP端口21上的控制连接建立连接。而SFTP是在客户端和服务器之间通过SSH协议( 阅读全文
posted @ 2022-03-09 17:27 江戸川のコナン 阅读(1270) 评论(0) 推荐(0) 编辑
摘要: reids hgetall 脚本 import redis # 建立连接池 r = redis.Redis(host='*************', port=*********, password='**********', db=10) # 获取到的是字典类型的值 data = r.hgeta 阅读全文
posted @ 2021-12-22 17:48 江戸川のコナン 阅读(405) 评论(0) 推荐(0) 编辑
……