文章分类 -  Python练习

摘要:# 打印程序运行时间 def runtime(func): start_t = time.time() @functools.wraps(func) def wrapper(*args, **kw): rt = func(*args, **kw) end_t = time.time() print( 阅读全文
posted @ 2022-03-21 14:13 xmc_2022 阅读(17) 评论(0) 推荐(0) 编辑
摘要:获取主机cpu,内存, 磁盘使用率 获取网段有多少ip地址 解析域名IP地址 清除redis缓存 转载https://www.jianshu.com/p/05a9baf0d942 阅读全文
posted @ 2019-11-26 11:50 xmc_2022 阅读(136) 评论(0) 推荐(0) 编辑
摘要:安装python客户端 下载python客户端wget “https://pypi.python.org/packages/68/44/5efe9e98ad83ef5b742ce62a15bea609ed5a0d1caf35b79257ddb324031a/redis-2.10.5.tar.gz#m 阅读全文
posted @ 2019-11-25 11:06 xmc_2022 阅读(245) 评论(0) 推荐(0) 编辑
摘要:给定一个文件,统计url出现的数量,并排序 文件如下url.text 思路:根据正则匹配出url,然后使用Counter模块进行计数,最后用sorted进行排序 阅读全文
posted @ 2019-05-07 17:32 xmc_2022 阅读(523) 评论(0) 推荐(0) 编辑
摘要:#!/usr/bin/python import os import shutil def move_files(path,new_path,size): for root,dirs ,files in os.walk(path): for file in files: file_path=os.path.join(root,file) ... 阅读全文
posted @ 2019-05-07 16:16 xmc_2022 阅读(150) 评论(0) 推荐(0) 编辑
摘要:Python 练习册,每天一个小程序,第0001题 阅读全文
posted @ 2019-04-24 15:48 xmc_2022 阅读(208) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示