摘要: import logging import sys class ConsoleHandler(logging.Handler): terminator = '\n' def __init__(self, level=logging.NOTSET): super().__init__(level) def _flush(self, stream): ... 阅读全文
posted @ 2018-01-24 11:40 stone_wl 阅读(436) 评论(0) 推荐(0) 编辑
摘要: #!/usr/bin/env python3 # -*- coding: utf-8 -*- import os import tempfile from collections import namedtuple from ansible.parsing.dataloader import Dat 阅读全文
posted @ 2018-01-09 17:47 stone_wl 阅读(6147) 评论(2) 推荐(0) 编辑
摘要: 安装依赖:pip install watchdog 阅读全文
posted @ 2017-09-01 20:13 stone_wl 阅读(5281) 评论(0) 推荐(0) 编辑
摘要: import threading import inspect import ctypes def _async_raise(tid, exc_type): """raises the exception, performs cleanup if needed""" if not inspect.isclass(exc_type): raise TypeErr... 阅读全文
posted @ 2017-08-14 15:29 stone_wl 阅读(1497) 评论(1) 推荐(0) 编辑
摘要: import socket import struct if __name__ == '__main__': ip = '127.0.0.1' int_ip = struct.unpack('!I', socket.inet_aton(ip))[0] print(int_ip) str_ip = socket.inet_ntoa(struct.pack('!I'... 阅读全文
posted @ 2017-08-14 15:24 stone_wl 阅读(2289) 评论(0) 推荐(0) 编辑
摘要: 1.分配光驱 2.安装相关依赖包 yum install -y bzip2 gcc gcc-devel gcc-c++ gcc-c++-devel make kernel-d 3.创建临时文件夹 mkdir /mnt/cdrom 4.挂载并安装 mount -t auto -r /dev/cdrom 阅读全文
posted @ 2017-06-01 16:20 stone_wl 阅读(3499) 评论(1) 推荐(0) 编辑
摘要: 1,将城市地图拆分等距拆分为矩形 数据结构如图: 2.查看高德JS API (点是否在多边形内)核心代码: 3.将js代码解析为SQL (未考虑使用函数,因在其他平台上使用) 4.执行结果 阅读全文
posted @ 2017-03-04 20:42 stone_wl 阅读(2318) 评论(0) 推荐(0) 编辑
摘要: 将一个城市的地图按照每1平方公里进行拆分为若干个区域(地图使用高德) 如图: 核心代码(Python 3.5): .env 阅读全文
posted @ 2017-01-18 16:47 stone_wl 阅读(2111) 评论(0) 推荐(0) 编辑
摘要: 数据来源(国家统计局):http://www.stats.gov.cn/tjsj/tjbz/xzqhdm/ 对数据进行的特殊处理: 下载数据↓↓↓ 阅读全文
posted @ 2016-11-18 00:58 stone_wl 阅读(952) 评论(0) 推荐(1) 编辑
摘要: $pip install mysqlclient 运行结果如下: 可能是由于不兼容导致的(中间试过各种方法,比如本地安装mysql等等),最后找来mysqlclient-1.3.7-cp35-cp35m-win_amd64.whl资源,安装成功! $pip install mysqlclient-1 阅读全文
posted @ 2016-09-02 15:58 stone_wl 阅读(6081) 评论(0) 推荐(0) 编辑