随笔分类 -  python

python 解决Could not import the lzma module. Your installed Python is incomplete问题
摘要:python 安装好pandas后import报错 如下图: ![image](https://img2023.cnblogs.com/blog/2865005/202308/2865005-20230815114944834-59637183.png) >原因分析 在执行./configure和m 阅读全文
posted @ 2023-08-15 11:53 每天进步一点点点点点 阅读(485) 评论(0) 推荐(0)
Python 编写的自动验证端口的脚本
摘要:以下是一个使用 Python 编写的自动验证端口的脚本示例: ```python import socket def connection_host(host, port): cli = socket.socket(family=socket.AF_INET, type=socket.SOCK_ST 阅读全文
posted @ 2023-05-25 15:04 每天进步一点点点点点 阅读(148) 评论(0) 推荐(0)
python 将print内容打印到文件中
摘要:python中print内容打印到文件中 import sys file = open("502log.txt", 'a') sys.stdout = file print(time.asctime(),"开始请求。。。。。") file.close() 这里将print的内容写到文件中,这只是其中 阅读全文
posted @ 2022-09-07 16:51 每天进步一点点点点点 阅读(252) 评论(0) 推荐(0)
python 读写excel
摘要:读取excel中的内容 def get_app_service(): df = pd.read_excel("test.xlsx",sheet_name='test') #读取excel对应的sheet data = list(df['service']) #读取一列 # print(data) r 阅读全文
posted @ 2022-06-17 08:09 每天进步一点点点点点 阅读(187) 评论(0) 推荐(0)
python 查找嵌套列表中的最大值
摘要:随机生成嵌套列表 nst = [ [1001, 0.0009], [1005, 0.07682], [1201, 0.57894], [1677, 0.0977] ] 从这个嵌套列表中,我们想得到嵌套列表中第 2 个元素的最大值。我们还想把第 1 个元素打印出来,并把它当作一个索引。嵌套列表的处理方 阅读全文
posted @ 2022-06-15 10:40 每天进步一点点点点点 阅读(1015) 评论(0) 推荐(0)