摘要: # 初始化d = {'a':1, 2:'b', 'c':3, 4:'d'}print(d)print('')###?? # 获取长度print(len(d))#4‘print('') # 根据key读写d['a'] = 100d[4] = 'dd'print(d)print('') # 添加元素d[ 阅读全文
posted @ 2020-02-17 15:01 lxm_001 阅读(303) 评论(0) 推荐(0) 编辑
摘要: anaconda使用 常用命令 更新包:conda upgrade –all 列出已安装包:conda list 安装包:conda install package(=version) 删除包:conda remove package 搜索包名:conda search xxx 这些命令在cmd中, 阅读全文
posted @ 2020-02-14 17:40 lxm_001 阅读(125) 评论(0) 推荐(0) 编辑
摘要: 恢复内容开始 Python range() 函数用法 start: 计数从 start 开始。默认是从 0 开始。例如range(5)等价于range(0, 5); stop: 计数到 stop 结束,但不包括 stop。例如:range(0, 5) 是[0, 1, 2, 3, 4]没有5 step 阅读全文
posted @ 2020-01-17 13:06 lxm_001 阅读(101) 评论(0) 推荐(0) 编辑
摘要: 爬虫性能相关 -傻等 response=request.get() -机智 response=request.get(); response=request.get(); response=request.get() 线程多了,也不好,所以有线程池。 pool=ThreadPoolExecutor( 阅读全文
posted @ 2019-06-18 01:32 lxm_001 阅读(137) 评论(0) 推荐(0) 编辑
摘要: 明星热度分析hadoop: https://www.cnblogs.com/zimo-jing/p/9028026.html SSH 为 Secure Shell ,传统的网络服务程序。 数据结构 是计算机存储、组织数据的方式。数据结构是指相互之间存在一种或多种特定关系的数据元素的集合。通常情况下, 阅读全文
posted @ 2019-05-27 13:52 lxm_001 阅读(84) 评论(0) 推荐(0) 编辑
摘要: 1.scrapy KeyError: 'Spider not found: doubanmovie' FAQ spider.py中的name =”douban”,在运行时应是douban,不是douban.py 2.python: can't open file 'h.py': [Errno 2] 阅读全文
posted @ 2019-05-23 03:33 lxm_001 阅读(320) 评论(0) 推荐(0) 编辑
摘要: 解决方法:只需安装一个包 cryptography ,打开cmd,输入 pip install -I cryptography 阅读全文
posted @ 2019-05-21 19:18 lxm_001 阅读(353) 评论(0) 推荐(0) 编辑
摘要: scrapy框架: 下载页面;解析;并发,深度。 scrapy engine:相当于while循环,调用调度器的url。 scheduler(调度器):所以的url存储。 在实际中,只需要编写spiders即可。 使用scrapy:指定初始的url; 解析器响应内容 -给调度器 -给item,pip 阅读全文
posted @ 2019-05-21 15:47 lxm_001 阅读(171) 评论(0) 推荐(0) 编辑
摘要: 阅读全文
posted @ 2019-05-21 15:29 lxm_001 阅读(1742) 评论(0) 推荐(0) 编辑
摘要: 1.交互模式(cmd中,输入python,出现的>>>,就是交互模式) 方便、测试、提示 例如:>>>import os >>>os.getcwd() 输出当前路径。 2.使用交互模式的注意项: 只能输入python命令;必须print()输出; 交互模式目前不需要缩进; 注意提示符和复合语句,>> 阅读全文
posted @ 2019-05-21 14:38 lxm_001 阅读(216) 评论(0) 推荐(0) 编辑