2018年8月27日
摘要: generator保存的是算法,元素仅在使用的时候生成,占用内存小,总元素的个数可以是无限个。 简单的生成器与列表生成式,区别仅在于将中括号[ ],换成小圆括号( ). In [1]: g=(x*x+2 for x in range(5)) In [2]: g Out[2]: <generator 阅读全文
posted @ 2018-08-27 17:29 庭明 阅读(272) 评论(0) 推荐(0) 编辑
摘要: 依次打开 Tools > Developer(开发者选项) > new Snippet(新的代码块)。可以看到注释的说明: <snippet> <content><![CDATA[ Hello, ${1:this} is a ${2:snippet}. ]]></content> <!-- Opti 阅读全文
posted @ 2018-08-27 17:29 庭明 阅读(444) 评论(0) 推荐(0) 编辑
摘要: python 3.4以后StringIO和cStringIO就没有了,转移到 io,的StringIO和BytesIO from io import StringIO fp=StringIO( ) 1.StringIO模块 StringIO用于像文件一样对字符串缓冲区或者叫做内存文件进行读写。 f 阅读全文
posted @ 2018-08-27 17:28 庭明 阅读(8397) 评论(0) 推荐(0) 编辑
摘要: https://www.postgresql.org/docs/current/static/sql-copy.html 一、Copy的基本语法 Copy的作用是复制数据在数据表和文件之间。 Copy在PostgreSql中的语法是(来自文档): 1、 将文件中的数据复制到表中: COPY tabl 阅读全文
posted @ 2018-08-27 17:28 庭明 阅读(1194) 评论(0) 推荐(0) 编辑
摘要: 1 运行方式一 (proxy-ip) [root@192 ~]# cd /data/test-proxy-ip/ (proxy-ip) [root@192 test-proxy-ip]# scrapy list proxy_ip (proxy-ip) [root@192 test-proxy-ip] 阅读全文
posted @ 2018-08-27 17:27 庭明 阅读(439) 评论(0) 推荐(0) 编辑
摘要: from scrapy import Selector >>> doc = """ ... <div> ... <ul> ... <li class="item-0"><a href="link1.html">first item</a></li> ... <li class="item-1"><a 阅读全文
posted @ 2018-08-27 17:19 庭明 阅读(93) 评论(0) 推荐(0) 编辑
摘要: google的驱动:chromedriver.exe 驱动版本与chrome版本对应的目录: http://npm.taobao.org/mirrors/chromedriver/2.32/notes.txt http://npm.taobao.org/mirrors/chromedriver/2. 阅读全文
posted @ 2018-08-27 11:45 庭明 阅读(1184) 评论(0) 推荐(0) 编辑
摘要: python内置函数,传入列表,返回索引值与列表元素 for index, item in enumerate(list1): print index, item 阅读全文
posted @ 2018-08-27 11:41 庭明 阅读(139) 评论(0) 推荐(0) 编辑
摘要: 1. 作用:向 SQL Server 实用工具发出一批 Transact-SQL 语句结束的信号.2. 语法:一批 Transact-SQL 语句GO如Select 1Select 2Select 3GO3. 说明:1) GO 不是 Transact-SQL 语句;2) 它是 sqlcmd 和 os 阅读全文
posted @ 2018-08-27 11:39 庭明 阅读(1071) 评论(0) 推荐(0) 编辑
摘要: pip freeze可以查看已经安装的python软件包和版本 pip list 也可以 阅读全文
posted @ 2018-08-27 11:31 庭明 阅读(337) 评论(0) 推荐(0) 编辑