python
jlulxg
这个作者很懒,什么都没留下…
展开
-
使用Python监视指定目录下文件变更
# -*- coding: utf-8 -*-# @Author: xiaodong# @Date: just hide# @Last Modified by: xiaodong# @Last Modified time: just hideimport osimport globimport jsonimport datetimefrom typing import...转载 2018-10-12 18:56:48 · 1289 阅读 · 0 评论 -
Python多线程小例子
版权声明:拥抱开源,欢迎转载,转载请保留原文链接~ https://blog.csdn.net/u010429424/article/details/76100149 Python多线程小例子1、在主线程中创建子线程 下面的代码一共创建了三个线程:主线...转载 2018-10-12 19:27:37 · 133 阅读 · 0 评论 -
Python多进程
版权声明:拥抱开源,欢迎转载,转载请保留原文链接~ https://blog.csdn.net/u010429424/article/details/76147368 Python多进程1、在主进程中创建子进程python为我们提供了Process类,用于...转载 2018-10-12 19:28:43 · 124 阅读 · 0 评论 -
python正则过滤字母、数字及特殊字符
import res = '1123*#$ 中abc国'str = re.sub('[a-zA-Z0-9’!"#$%&\'()*+,-./:;<=>?@,。?★、…【】《》?“”‘’![\\]^_`{|}~\s]+', "", s)# 去除不可见字符str = re.sub('[\001\002\003\004\005\006\007\x08\x09\x0a\x0b...转载 2018-11-30 14:49:54 · 38490 阅读 · 3 评论 -
正则表达式替换掉汉字中间的空格
替换掉汉字中间的空格 import re original_str = 'a a 我我我 我我 我 我 sf ssf' patten = re.compile(r'([\w\u4e00-\u9fa5]{1})\s+([\u4e00-\u9fa5]{1})')original_str = patten.sub(r'\1\2',original_str ).strip(...原创 2018-12-20 16:20:55 · 7535 阅读 · 0 评论 -
python 主线程捕获子线程异常的方法
from threading import Threadimport tracebackclass PropagatingThread(Thread): def run(self): self.exc = None try: if hasattr(self, '_Thread__target'): ...原创 2019-07-08 20:22:12 · 2947 阅读 · 0 评论