![](https://img-blog.csdnimg.cn/20201014180756754.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
python
文章平均质量分 73
seraphtab
这个作者很懒,什么都没留下…
展开
-
python 目录遍历
#! /usr/bin/python import os import sys def dir(path): list = os.listdir(path) for l in list: file_path = os.path.join(path,l) print file_path原创 2015-09-02 12:14:39 · 395 阅读 · 0 评论 -
python 文件增量备份
#!/usr/bin/python #-*-coding:utf-8-*- #Filename: auto_bak.py #Author: zz import os import sys def get_dir(path): print path, '\n' return os.listdir(path) def bak_file(path,path_bak):转载 2015-09-02 13:26:40 · 1316 阅读 · 0 评论 -
简易的监控系统
首先数据库建表 建立一个数据库“falcon”,建表语句如下:CREATE TABLE `stat` ( `id` int(11) unsigned NOT NULL AUTO_INCREMENT, `host` varchar(256) DEFAULT NULL, `mem_free` int(11) DEFAULT NULL, `mem_usage` int(11) DE转载 2015-09-08 21:39:39 · 414 阅读 · 0 评论 -
python统计日志ip
import re tudou@Gyyx f=open("/tmp/a.log","r") arr={} lines = f.readlines() for line in lines: ipaddress=re.compile(r'^#(((2[0-4]\d|25[0-5]|[01]?\d\d?)\.){3}(2[0-4]\d|25[0-5]|[01]?\d\d?转载 2015-09-06 22:38:36 · 406 阅读 · 0 评论