摘要: 用 Python 写的一个记录上网用时的小脚本(自用),上网时间记录在 sqllite 数据库中通过访问某个网站来判断网络是否连接或断开#!/usr/bin/env python# -*- coding: utf-8 -*-import timeimport urllib2import ConfigParserimport sqlite3# 记录上网时长,并将数据写入到数据库# 插入数据def insert_data(xcur, start_time, end_time, total_time): sql = 'INSERT INTO time(starttime, endtime, 阅读全文
posted @ 2011-06-03 14:27 mozillazg 阅读(854) 评论(1) 推荐(1) 编辑