python
文章平均质量分 54
后厂村葫芦娃
这个作者很懒,什么都没留下…
展开
-
最详细的python装饰器详解
先直接看例子def play1(fn): def inner(x, y, *args, **kwargs): print(args[0]) print(kwargs.get('name')) b = fn(x, y) print('b: ' + str(b)) print('99999') return b return innerdef play2(f1): def inn.原创 2020-08-28 17:19:56 · 238 阅读 · 0 评论 -
AttributeError: 'module' object has no attribute 'lru_cache'
报错如下:Connected to pydev debugger (build 172.4343.24)Traceback (most recent call last): File "D:\soft\pycharm\PyCharm 2017.2.4\helpers\pydev\pydevd.py", line 1599, in <module> globals = ...原创 2018-07-24 22:09:50 · 5195 阅读 · 0 评论 -
python3.6.5 centos快速安装
#!/bin/bashyum groupinstall 'Development Tools'yum install zlib-devel bzip2-devel openssl-devel ncurses-develwget --no-check-certificate https://www.python.org/ftp/python/3.6.5/Python-3.6.5.tgz...原创 2019-07-02 17:51:27 · 227 阅读 · 0 评论 -
python3进程池pool使用及注意事项
1.在python中使用进程池主要就是为了并行处理任务,缩短运行时间2.经常使用方法: 同步有 apply(), map();异步的有 apply_async(), map_async()3. 先看几个小例子import time from multiprocessing import Pool test = [1,2,3,4,5,6,7,8]def run(fn): ti...原创 2019-09-24 17:25:00 · 1802 阅读 · 1 评论