Python学习记录
2017-10-14 07:34
239 查看
Zip 函数可以进行多个list的迭代
for price, info, total_deal, seller, location in zip(prices, infos, total_deals, sellers, locations): products = { 'price': price, 'info': info.strip(), 'total_deal': total_deal, 'seller': seller.strip(), 'location': location, } print(products)
将几个list的元素合并为一个list的方法 使用extendA = [1,2,3]B = [3,4,5]A.extend(B)或者直接相加A + B = 一个新的list
因为学习爬虫需要redis和MongoDB
启动redis 先进入redis路径 再启用redis-server然后就开启了redis启动MongoDB 先进入MongoDB的路径 然后再sudo mongod 即可
相关文章推荐
- python学习记录
- Python学习记录-2016-01-07
- python第五天学习记录——模块
- Python学习记录----数据定义
- python核心编程学习记录之面向对象编程
- Python模块学习 ---- logging 日志记录
- Python学习记录(六)
- python 学习记录(7)-循环/结构化程序(冒泡排序)
- python[函数]学习记录
- 《Python 核心编程》 学习记录
- 【Python3.6爬虫学习记录】(十三)在阿里云服务器上运行爬虫
- Python学习记录(3)
- Python学习记录八---异常
- Python学习记录day5
- python学习记录-- 数据结构----栈
- 我的Python学习记录
- python学习记录--日期和时间
- 记录Python学习中的几个小问题
- Python之待学习记录
- Python基础学习--记录知识点