上一页 1 ··· 8 9 10 11 12
摘要: Python的数据缓存 python 的内置数据类型,数值型,字符串,列表,字典等都会有自己的对象缓存池, 这样做的好处是,避免了频繁的申请内存,释放内存,这样会极大的降低应用程序的运行速度,还会造成大量的内存碎片。因此提供对象缓存机制是非常重要的。 在Python中,字符串和整型对象都是不可变的( 阅读全文
posted @ 2020-12-09 14:23 rm-rf* 阅读(1500) 评论(2) 推荐(0) 编辑
摘要: 安装scrapy centos 7 安装scrapy报错说找不到scrapy需要的Twisted13.0以上版本? Collecting Twisted>=13.1.0 (from Scrapy) Could not find a version that satisfies the require 阅读全文
posted @ 2020-12-09 14:22 rm-rf* 阅读(82) 评论(0) 推荐(0) 编辑
摘要: 异步调用(坑) from concurrent.futures import ThreadPoolExecutor executor = ThreadPoolExecutor(5) def review(): '''省略过程''' #异步提交任务 executor.submit(call_crawl 阅读全文
posted @ 2020-12-09 14:21 rm-rf* 阅读(94) 评论(0) 推荐(0) 编辑
摘要: linux系统添加用户 增加用户: useradd -d /usr/username -m username 为用户增加密码: passwd username 新建工作组: groupadd groupname 将用户添加进工作组: usermod -G groupname username 删除用 阅读全文
posted @ 2020-12-09 14:20 rm-rf* 阅读(109) 评论(0) 推荐(0) 编辑
摘要: Scrapy+Scrapyd+Scrapydweb实现爬虫可视化 Scrapyd是一个服务,用来运行scrapy爬虫的 它允许你部署你的scrapy项目以及通过HTTP JSON的方式控制你的爬虫 官方文档:http://scrapyd.readthedocs.org/ 安装scrapyd pip 阅读全文
posted @ 2020-12-09 14:19 rm-rf* 阅读(437) 评论(0) 推荐(0) 编辑
摘要: Gunicorn配置 # -*- coding: utf-8 -*- import os from multiprocessing import cpu_count bind = "127.0.0.1:9000" daemon = True workers = cpu_count() * 2 wor 阅读全文
posted @ 2020-12-09 14:17 rm-rf* 阅读(172) 评论(0) 推荐(0) 编辑
摘要: Editor.md解决跨域上传的问题 编辑 editormd\plugins\image-dialog\image-dialog.js 替换以下代码片段 if (settings.crossDomainUpload) { action += "&callback=" + settings.uploa 阅读全文
posted @ 2020-12-09 14:16 rm-rf* 阅读(310) 评论(0) 推荐(0) 编辑
摘要: Nginx的安装及相关配置 Nginx 是 C语言 开发,建议在 Linux 上运行,当然,也可以安装 Windows 版本,本篇则使用 CentOS 7 作为安装环境。 一. gcc 安装 安装 nginx 需要先将官网下载的源码进行编译,编译依赖 gcc 环境,如果没有 gcc 环境,则需要安装 阅读全文
posted @ 2020-12-09 14:07 rm-rf* 阅读(123) 评论(0) 推荐(0) 编辑
摘要: #MariaDB的安装及相关配置 安装 yum -y install mariadb mariadb-server 安装完成MariaDB,首先启动MariaDB systemctl start mariadb 设置开机启动 systemctl enable mariadb ###登录及密码 mys 阅读全文
posted @ 2020-12-09 14:05 rm-rf* 阅读(168) 评论(0) 推荐(0) 编辑
摘要: 浅拷贝只拷贝对象本身, 对象(如 list, dict)中的子元素不会被拷贝,而是依旧引用原对象。深拷贝会将对象即其中的包含的子元素全部拷贝一份。 from copy import copy, deepcopy a = [1, 2, 3] b = copy(a) c = deepcopy(a) 阅读全文
posted @ 2020-12-08 16:59 rm-rf* 阅读(69) 评论(0) 推荐(0) 编辑
上一页 1 ··· 8 9 10 11 12